Hi,
In my IA project that installs or updates (after uninstalling the program), I have IA run a program that updates a database. If the database update fails for any reason, the program will/can exit with an errorcode != 0 or perhaps create a semafore a file if necessary.
What I want to do is check the errorlevel returned by the database update program and if appropriate force the whole IA installation to to fully rollback.
I'm using IA v11.
Has anyone got some practical experience with this scenario and could they please either share their IA code or point me in the right direction to achieve this.
Thanks,
Forcing a rollback of installation
Re: Forcing a rollback of installation
Hi,
The best way do to this is create a batch script that writes %errorlever% to a file.
You can then call this bat script from InstallAware and read the content of the created file..
You can also create a DLL or a plugin that will get the error level and return it, but it will probably require more work.
The best way do to this is create a batch script that writes %errorlever% to a file.
You can then call this bat script from InstallAware and read the content of the created file..
You can also create a DLL or a plugin that will get the error level and return it, but it will probably require more work.
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Forcing a rollback of installation
Hi,
Thanks for that .. it should be the easy part because I already do something similar elsewhere in IA.
The part that I need confirmation is, what variable do I have to set so that IA will stop processing and perform the full rollback.
Thanks for that .. it should be the easy part because I already do something similar elsewhere in IA.
The part that I need confirmation is, what variable do I have to set so that IA will stop processing and perform the full rollback.
Re: Forcing a rollback of installation
You don't need to set any variables - you can have your batch file wait for the 3rd party program to run, and therefore InstallAware will also wait for the batch file to complete.
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Forcing a rollback of installation
Ok - but how does IA know whether it ran successfully or not. In other words, how does IA know whether to continue with the installation or stop and perform a roll back?
Re: Forcing a rollback of installation
You can read the error level and create an If block that rolls back and exists the installer if it is not 0.
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Forcing a rollback of installation
Unless I hear otherwise, and until I test it myself, I will assume that 'Terminate Install' automatically performs a rollback of the installation so far.giaviv wrote:You can read the error level and create an If block that rolls back and exists the installer if it is not 0.
Re: Forcing a rollback of installation
Hi,
That's not accurate - please read the MSI Transaction section in the F1 help files - it will clarify exactly how transactions work - thanks!
That's not accurate - please read the MSI Transaction section in the F1 help files - it will clarify exactly how transactions work - thanks!
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

