Backup_restore problems - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

hho
Posts: 4
Joined: Mon May 10, 2010 9:54 am

Backup_restore problems

I'm trying to follow this guide How do I prevent a file from being replaced by a newer version?

I have followed the guide, but the problem is that the files aren't backup'ed.
The problem appears to be that the BackupList property is not set properly. However I cannot figure out why this fails.

From the log-file:

Code: Select all

MSI (s) (44:80) [10:44:06:706]: Doing action: Set_BackupList
Action 10:44:06: Set_BackupList. 
Action start 10:44:06: Set_BackupList.
MSI (s) (44:80) [10:44:06:706]: Note: 1: 2715 2: file1.txt 
MSI (s) (44:80) [10:44:06:706]: Note: 1: 2715 2: file2.txt 
MSI (s) (44:80) [10:44:06:706]: Note: 1: 2753 2: file3.ini 
MSI (s) (44:80) [10:44:06:706]: PROPERTY CHANGE: Adding BackupList property. Its value is '"|||"'.
Action ended 10:44:06: Set_BackupList. Return value 1.
I've copied the customactions from the p2 example included in the script-zip file.
When using the p2.msi (modified slightly to use other files and upgrade another product) i get a different output:

Code: Select all

Action 10:06:41: Set_BackupList. 
Action start 10:06:41: Set_BackupList.
MSI (s) (94:74) [10:06:41:257]: PROPERTY CHANGE: Adding BackupList property. Its value is 'C:\Documents and Settings\All Users\Application Data\Your Application\file_to_backup2.txt|C:\Documents and Settings\All Users\Application Data\Your Application\folder_to_backup2\|C:\Programmer\Us\Our App\file_to_backup.txt|C:\Programmer\Us\Our App\file3.ini'.
Action ended 10:06:41: Set_BackupList. Return value 1.
So I'm wondering why there a difference in e.g why are there lines like the following in our own project msi-log, why aren't they pressent in the p2 project msi-log?:

Code: Select all

MSI (s) (44:80) [10:44:06:706]: Note: 1: 2753 2: file3.ini 
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Backup_restore problems

Hi,

It seems that you didn't use references to files in your package for the backup list. For a "Property set with formatted" custom action you can use the "Edit..." button next to "Formatted Text" field to add a file reference.

Please note that another approach is to use the "Persistent User Data" wizard from the "Wizards" menu.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hho
Posts: 4
Joined: Mon May 10, 2010 9:54 am

Re: Backup_restore problems

do you mean like this?

Code: Select all

[#file1.txt]|[#file2.txt]|[#file3.ini]
That's how they are already.
(I used the edit button and then inserted the filenames through the contextmenu "File..." and then selected a file from the Application Folder)

Inserting

Code: Select all

[#File2.ini]|[APPDIR]file3.ini
gives me this in the log file:

Code: Select all

Action start 12:33:56: Set_BackupList.
MSI (s) (9C:4C) [12:33:56:952]: Note: 1: 2753 2: File2.ini 
MSI (s) (9C:4C) [12:33:56:962]: PROPERTY CHANGE: Adding BackupList property. Its value is '|C:\Programmer\Us\Our App\File3.ini'.
Action ended 12:33:56: Set_BackupList. Return value 1.
Both files existed in the previous install

The "Persistent User Data" wizard it requires the "Install new version first and then uninstall old version" wich is compatible with Firewall rules that are in our package
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Backup_restore problems

Hi,
Both files existed in the previous install
Please note that file references are resolved to file paths from the current project. If the files are not included in your project, you can try using formatted paths with a predefined folder and the filename. For example:

Code: Select all

[APPDIR]File2.ini|[APPDIR]file3.ini
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hho
Posts: 4
Joined: Mon May 10, 2010 9:54 am

Re: Backup_restore problems

The files are pressent in the new project (otherwise I would not be able to select them from the "Choose Installation File" dialog, right?)

Does it in any way relate to msi from the upgraded app? (wich we did not make with Advanced Installer)
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Backup_restore problems

Hi,

The problem is not related with older packages, it's in the MSI which runs the custom action.

Error 2715 means "The specified File key ('[2]') not found in the File table.". This means that the file reference you are using is invalid, it doesn't point to a file in your MSI. According to your log fragments it was shown for "file1.txt" and "file2.txt".

Error 2753 means "The File '[2]' is not marked for installation.". Therefore you are using the file path of a file which will not be installed. According to your log fragments it was shown for "file3.ini" and "File2.ini".

Please make sure that you are using valid file paths for the custom action. The files don't need to be included in the package, but you should use file references only for files which will be installed by your MSI.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hho
Posts: 4
Joined: Mon May 10, 2010 9:54 am

Re: Backup_restore problems

Thank you for your response and assistance. I've finally solved the problem :)

WRT 2715, I'm sorry. I knew those files wheren't part of the projekt i should have made that clear.
WRT 2753 The problem appears to be that I selected "Never overwrite" under for that component.

The problem is that this condition is evaluated before the old product is unistalled and since the file would be present it was not marked for installation.
However the file would be removed by the unistallation, and therefore no longer be present when then installation finished (bc is was marked not for installation).
I wasn't aware that this would also affect the evaluation of [#file]
(Seems counterintuitive to me the they aren't evaluated at installtime)

Anyways the end result (before my findings) was that the file wasn't installed during upgrade, only clean install or repair after upgrade)

Still, one thing is strange to me: the files that are marked for backup/restore aren't removed unistalled (even if they were installed during a clean install and none of the files were present before installation)
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Backup_restore problems

Hi,
Anyways the end result (before my findings) was that the file wasn't installed during upgrade, only clean install or repair after upgrade)
This is a known Windows Installer bug related to file versioning rules. A solution is to use the "Ensure that this file overwrites any installed target file" option in the Version tab of the "Edit File" dialog.
Still, one thing is strange to me: the files that are marked for backup/restore aren't removed unistalled (even if they were installed during a clean install and none of the files were present before installation)
Does this happen when the files are marked for installation? If so, can you please send us the .AIP (project) file you are using and a verbose log of the uninstall process to support at advancedinstaller dot com so we can investigate them? Please note that files which are not marked for installation are not installed, therefore they will not be uninstalled even if they are copied by custom actions.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”