kissack
Posts: 57
Joined: Fri Feb 04, 2011 11:45 am

Update files from custom action during upgrade

Hello,
I would appreciate some help with this scenario.

Here what I am trying to achieve.

1. Previous version of application installed
2. Run an upgrade. Execute OnCommitted custom action that updates a version in local *.mdb file (Access DB).
3. Finish the upgrade and the previous state of the *.mdb file is preserved.

I suspect the reason is this MDB file is in directory that has the following conditionL: Overwrite Behavior - Do Not overwrite existing files condition = OLDPRODUCTS
So it seems that AI, takes these files not to be overwritten and copies them apart (temp), installs the new version, updates the DB from the custom action and then overwrites the files with the original (from temp) location.
I am running the .NET Installer custom action before Finish Execution Step in Install Execution Stage. (Marked Upgrade)

Any ideas how to set it up un such way so I can modify the existing MDB file

Thank you.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Update files from custom action during upgrade

Hi,

Indeed, when the "Do not overwrite existing files condition" option is used, the files are backed up before the upgrade and restored after the upgrade of the application.

If you want to modify your file after it was restored, you can use the "Move" button for your custom action and place it between the "InstallExecute" and "InstallFinalize" standard actions from the "Install Execution Stage -> Finish Execution" action group.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kissack
Posts: 57
Joined: Fri Feb 04, 2011 11:45 am

Re: Update files from custom action during upgrade

Hi, yes it worked. Sorry for not getting back to you.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Update files from custom action during upgrade

No problem. I'm glad it worked.

Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”