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!

see
Posts: 11
Joined: Wed Aug 12, 2015 7:16 am

[SOLVED] Rollback upgrade

Oi oi,

situation: during an upgrade I get an error and rollback ... how can I achieve that it falls back to the previous upgrade version?

situation 2: I want to copy files from the setup before the setup copies files ... how can I achieve that?

Can somebody help me?

Thank you,
see
Last edited by see on Wed Sep 30, 2015 7:15 am, edited 1 time in total.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Rollback upgrade

Hello,
situation: during an upgrade I get an error and rollback ... how can I achieve that it falls back to the previous upgrade version?
An upgrade installation consists in two parts:
  • •the uninstall of the old product version
    •the installation of the new product version
When the error appears during the upgraded process, the rollback of the upgraded version is triggered. So, any files copied from the upgraded version will be removed from the target machine. However, the previous version will not be restored. It has been already uninstalled and the corresponding files removed.

In this case, you can change the upgrade process' sequence and select the Install new version first and then uninstall old version from the Upgrades Page. In this case, the installer updates files before removing the old applications. Only the files being updated get installed during the installation. If the old application's removal fails, then the installer rolls back both the old application's removal and the new application's install.
situation 2: I want to copy files from the setup before the setup copies files ... how can I achieve that?
In order to achieve that you can use our copy/move file operation support. For example, you can use a file move operation (added on install) which will move your target file in a backup folder and another file move operation (added on uninstall) which will restore the target file on its original location.

You can also achieve that using a custom action. Please take a look on our Make a backup copy before uninstall my application thread which debates a similar issue.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
see
Posts: 11
Joined: Wed Aug 12, 2015 7:16 am

Re: Rollback upgrade

In this case, the installer updates files before removing the old applications. Only the files being updated get installed during the installation. If the old application's removal fails, then the installer rolls back both the old application's removal and the new application's install.
I've tried the option "Install new version first and then uninstall old version", but if it fails, it doesn't rollback the files, it just stops and leaves some of them in the folder. Is that a bug or common behavior?

Another question: What is triggered first, if I add custom actions to "Add Resources" or "Remove resources"? The order in Advanced Installer's GUI is Remove and then Add. With install first and then uninstall, shouldn't it be different?
Or is "Add Resources" simply not called during uninstall of an upgrade?

Thank you so far!
see
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Rollback upgrade

Hi,

When the Install new version first and then uninstall old version option is selected, the upgrade process performs the following actions:
  • Start installation of the new product
  • Check for matching components between products. Install the new components from new product.
  • Uninstall the components that are not used by the new product.
So, the updated files are installed first and then the old files are removed. Resources that are shared by both packages will not be removed thus any change will be preserved.

Please take a look on the Windows Installer Upgrades article which may be useful to you.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
see
Posts: 11
Joined: Wed Aug 12, 2015 7:16 am

Re: Rollback upgrade

Oi,

the problem was, that the custom action (attached DLL) ran "immediate", I changed it to "deferred", now the order is correct.

Solved.

Thank you so far,
see
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: [SOLVED] Rollback upgrade

Hi,

I'm glad you got this working.
If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”