clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Update with dynamic URL

I use the auto updater for my application to update from a server on the LAN.

The problem is that the location to this server is entered (by the user) when my application is run, so I set the URL property in the updater.ini file at this point.
But when there is a major update that updates all of the files, the ini file is overwritten and I cannot have the server address re-entered by the user. So the URL property is now incorrect and my application cannot update.

Is there a way to keep the existing updater.ini file? or any other suggestions.

Thank you!
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You can prevent the updater.ini file to be overwritten by the newer version. All you need to do is to backup the old updater.ini file and restore it after the previous product has been removed. We have a tutorial on how to do this in the Help Documentation. Please follow this link: http://www.advancedinstaller.com/user-g ... le-ca.html

Note that you must modify those scripts to fit your needs.

Regards,
Gigi
________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Hi,

I followed the instructions at the link you provided, but under bullet 5 - sub-bullet 2: when selecting "Edit" and then "File", the "updater.ini" file does not appear in the list, so I used the same fomat ("[#updater.ini]") that is used for any other file. But the script does not find that file (I added message boxes as debug in the script) when trying to perform the backup function.

Please advise.

Thank you!
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The "Property Set With Formated" custom action sets a property from a formatted string. In our case sets the [KEEPFILE] property with the path of the file that you want to backup.

The "updater.ini" file is automatically added in the package when you select "Enable Advanced Updater" from "Updater" page.

Regards,
Gigi
___________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Hi,

Well its the "updater.ini" file i'm trying to backup and when you select "Enable Advanced Updater", AI includes "updater.ini" to the "Files and Folders" page.
I have made sure that it exists under the "Files and Folders" page. But it still does not appear in the list when creating the "Property Set With Formatted" (nor can the script find the file).

Thank you for your help.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Yes you are right. The "updater.ini" file is created with the package that's why it does not appear in the "Choose Installation File" dialog.

However you can use "Script Inline" custom action instead of "Property Set With Formatted" custom action with the "Script Text" edited to:

Code: Select all

Session.Property("KEEPFILE") = Session.Property("APPDIR")+"updater.ini"
Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Hi,

Ok, when using a Script Inline, the backup script works fine. Now I have a problem with the restore script.
When following the tutorial at (with exception to backup script) http://www.advancedinstaller.com/user-g ... le-ca.html, bullet point 7, the "updater.ini' file is restored fine and then is overwritten by the installer.
I tried to move the restore script custom action to "Commit" but then the restore script cannot find the temp folder Session property created in the backup script.

Please advise.
Thank you.
clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Hi,

I tried selecting "Permanent" and "Never Overwrite" attributes under the "Organization" page for the updater.exe file and that has solved the problem (updater.exe and updater.ini files are not overwritten on update).
But does this mean if the updater is changed (updated) in a new version of AI, the installed updater will never get updated?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

If you select "Permanent" flag for "updater.exe" from "Organization" page this means that the "updater.exe" and "updarer.ini" files are not removed during an uninstall. "Never Overwrite" means that those files mentioned above are not installed or reinstalled, if a key path file or a key path registry entry for the component already exists.

However I have tested the Backup and Restore scripts and work just fine. The "Restore" script runs as immediate on "InstallFinalize" standard action and at this point all the files should by already copied or created.

Regards,
Gigi
________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
clive_bor
Posts: 48
Joined: Thu Mar 09, 2006 8:32 am

Hi,

This does not work on my side (the "InstallFinalize" runs before it creates and copies the files here); I have tried all your suggestions and more, and it still does not work. The turnaround time of posting a question on the forum every time a suggestion doesn't work is taking too much of my time.

Could you please provide a sample AI project file that does not overwrite the "updater.ini" file when an update is installed.

Thank you.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Please post here your e-mail address or send us an e-mail to support at advancedinstaller dot com in order to send you a sample AI project that performs what you want to achieve.

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”