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!

Qureshi
Posts: 8
Joined: Tue Mar 31, 2015 2:05 pm

Rollback option Help

Hello,

In the advanced installer it is mentioned in the "Execution Options" of custom action that "Fail installation if custom action returns an error" , that means as soon as custom action returns value 3 (3=error value) then the whole process should rollback.


BUT please have a look into my attched "testrollback.aip" where i am trying to execute my custom action (testaction.vbs) which returns value '3' as soon as I select Next option in the dialog box "NewSeqDialog" (in First time Install). I was wandering technically it should rollback the whole installation process (so that i also do have to uninstall the app from the Control Panel-->Programs and Features manually). As Rollback funtionality should do every thing (e.g, unintall procedure) automatically.

but why it is not performing nay roll back function in my attached "testrollback.aip" ? please have a look.
Although at the end i get Message from the advanced installer that "the test setup wizard ended prematurely" and it is also not completely removing the app from the system and i have to do the un-installation by going to the Control Panel-->Programs and Features.

i know the uninstallation can be done by running my app from the advanced installer but then what's the purpose of rollback function.

What I want is as soon as there is an error (value=3) comes by some custom action. rollback functionality start and do all the uninstallation automatically. Please let me know about the possible options.

Thanks in advance,
Qureshi
Attachments
testrollback.zip
testing rollback
(3.36 KiB) Downloaded 262 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Rollback option Help

Hi Qureshi and welcome to Advanced Installer forums.

Please keep in mind that the rollback process will be triggered in an unsuccessful installation only if a "deferred" or "commit" custom action failed. The "immediately" custom actions will only interrupt the installation, but they will not trigger the rollback process.

For more details you can read the Rollback Custom Actions MSDN article.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Qureshi
Posts: 8
Joined: Tue Mar 31, 2015 2:05 pm

Re: Rollback option Help

Thanks Eusebiu and Hi,

I think you misunderstood me let me rephrase my question:
What i want is, let say after the installation if the user click Cancel button (at any stage) then the whole installation should rollback, one of my idea was to use a custom action script (assosiated with the cancel button) and returns an error value (say '3' ) as soon as the user click Cancel button then advanced installer will know automatically that something is went wrong and it should rolls back the whole process. Is there any way to do this roll back using button (e.g,Cancel button) ?

i guess the solution you mentioned cannot be done using the button ? or may be it is possible by some other way ? please let me know

Best Regards,
Qureshi
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Rollback option Help

Hi Qureshi,

The Windows Installer normal behavior is for the installation to be rolled back only if the "Cancel" button from the "ProgressDlg" dialog is pressed while the "deferred" or "commit" actions are executed.

Windows Installer considers that no modification was made to the system before those actions and the installation was successful after those actions. Those are the only actions that modify the system and only if they fail the installation is rolled back.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Qureshi
Posts: 8
Joined: Tue Mar 31, 2015 2:05 pm

Re: Rollback option Help

Hi,

"The Windows Installer normal behavior is for the installation to be rolled back only if the "Cancel" button from the "ProgressDlg" dialog is pressed while the "deferred" or "commit" actions are executed."

Does that means if the user press the canel button in the "TestSeqDlg" but not in the "ProgessDlg" then the system will not rollback , or in other word if the installation is finished (let say it was finshed in the "ProgessDlg") then there is no way to rollback ?

Problem is that when i add custom action script (which returns error value 3) (using launch attach file -->add custom action with sequence and select "deferred") as i did in my attach file ("testrollback.aip") and place it after the Add Resources. (in Install Execution stage) Then the system rollback in any case whether i press cancel or not because this will execute in any case. But this is not i want, i want to perform this action when user press Cancel button in the "TestSeqDlg" but then as custom action (my script) is added like using launch attach file -->add custom action with sequence and select "deferred". By doing this way i cannot access my custom action on TestSeqDlg (if i want to associate it with canel button).

On the other side as you know by adding custom action without sequence then selecting an option in Execution Time to "deferred or commit" is not possible. Is there any way to change/set this to "deferred or commit" when i add the custom action without sequence ? please also let me know

Thanks,
Qureshi
Attachments
testrollback.zip
(3.39 KiB) Downloaded 252 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Rollback option Help

Hi Qureshi,
Does that means if the user press the canel button in the "TestSeqDlg" but not in the "ProgessDlg" then the system will not rollback , or in other word if the installation is finished (let say it was finshed in the "ProgessDlg") then there is no way to rollback ?
Yes, this is right, there is no way to rollback the installation after the "ProgressDlg" dialog.
Problem is that when i add custom action script (which returns error value 3) (using launch attach file -->add custom action with sequence and select "deferred") as i did in my attach file ("testrollback.aip") and place it after the Add Resources. (in Install Execution stage) Then the system rollback in any case whether i press cancel or not because this will execute in any case. But this is not i want, i want to perform this action when user press Cancel button in the "TestSeqDlg" but then as custom action (my script) is added like using launch attach file -->add custom action with sequence and select "deferred". By doing this way i cannot access my custom action on TestSeqDlg (if i want to associate it with canel button).
Indeed, a custom action with sequence cannot be accessed on the dialogs.
On the other side as you know by adding custom action without sequence then selecting an option in Execution Time to "deferred or commit" is not possible. Is there any way to change/set this to "deferred or commit" when i add the custom action without sequence ? please also let me know
I'm afraid that the custom actions without sequence can only run as "immediately", they cannot be set as "deferred" or "commit". This is the Windows Installer normal behavior.

Can you please tell me why do you need to rollback the installation after it was completed successfully?

Best regards,
Eusebiu

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Qureshi
Posts: 8
Joined: Tue Mar 31, 2015 2:05 pm

Re: Rollback option Help

Thanks,

Imagine a situation where user run the executable file that installed all the files on the system and he has to wait until he got the responce file from somethird party. This responce file will be used further to activate the application. BUT in the meanwhile user decide to cancel the process and start the process again from scrach once he get the response file (and user do not have to do the uninstall manually from the Control Panel-->Programs and Features). by clicking cancel the process should be rollback.

My initial thought was that having a rollback functionality in adavnced installer could do the trick (rollback) at any stage. But as you said its not possible ?

Any suggestions about how to do rollback after the installation but before the exit dialog, do you have any idea ?

May be using something like writing a dll files as custom action as also mentioned here (http://www.advancedinstaller.com/user-g ... tions.html) that means by adding a custom action dll file without sequence i can also access the custom action in various dialog (button component etc,etc) but than again how to set it as deferred action is a problem ?

Best Regards,
Qureshi
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Rollback option Help

Hi Qureshi,

Please keep in mind that the rollback functionality is a Windows Installer feature available in any MSI package, it is not implemented by Advanced Installer this way.
My initial thought was that having a rollback functionality in adavnced installer could do the trick (rollback) at any stage. But as you said its not possible ?
Yes, I'm afraid that this is not possible.
Any suggestions about how to do rollback after the installation but before the exit dialog, do you have any idea ?
In order to achieve this, you can create a custom action that uninstalls your package and place it on the "Cancel" button of the dialog you want. For example, you can create a "Launch file" custom action as below:
  • File to launch: msiexec.exe
    Command line: /x [ProductCode] /qb
    WorkingDirectory: [SystemFolder]
Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Qureshi
Posts: 8
Joined: Tue Mar 31, 2015 2:05 pm

Re: Rollback option Help

thank you, that could be the solution but now i have another issue and i wander may be it's a bug ? or not , could you please check the attached files

for your concern i created two test applications:
(1) testapp.aip ----> consists of default dialogs + i added a new dialog (TestDialog) and there with the "Next" button i associated a custom action which returns "3" to Main (error code)
(2) testapp2.aip----> consists of default dialogs + i added a new dialog (TestDialog)and there with the "Next" button i associated a custom action which returns "3" to Main (error code) +now i only added one built-in dlg i.e, "ConfigureDlg"

The result of (1) (i.e, testapp.aip) is : should occur in principle that when custom action (testaction.vbs) returns "3" then "FatalError" Dlg appears (i-e Your Application setup wizard ended prematurely)---> that's working perfect and it shows the "FatalError" Dlg.

BUT problem occurs in the second test case (testapp2.aip)
As my custom action (same as use in testcase1) is returning an error value "3" in test case (2) (i.e, testapp2.aip) so technically i should get the same error dlg ( "FatalError" Dlg ) (i-e Your Application setup wizard ended prematurely) (the same as i was getting in the above testcase 1). But i did not get this error window ("FatalError"), instaed the "ExitDialog" appears next, which is not right. Could you please check whether it's a bug ? or ?

Thanks in advance,
Qureshi
Attachments
testapp2.zip
test case 2 , (2)
(3.28 KiB) Downloaded 249 times
test_app.zip
test case 1 , (1)
(3.17 KiB) Downloaded 238 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Rollback option Help

Hello,

First o all I apologize for my delayed reply. We had a few days off here due to the Orthodox Easter holidays and we are a bit rushed at the moment.

I've tested the behavior and I replicated the behavior. This seems to be an Advanced Installer issue caused by our "Enhanced User Interface" feature. The "ConfigureDlg" dialog is available only when the "EUI" feature is enabled, so when you add this dialog into your project the EUI will be automatically enabled. It seems this odd behavior is caused by our "EUI" feature. We'll try to add a fix in a future version of Advanced Installer, thank you for bringing this to our attention. We'll notify you when the fix will be out.

Until then, as a workaround, you can disable the "EUI" and also you should remove the "ConfigureDlg" dialog from your project.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Rollback option Help

Hello,

It took a while until we start investigating this behavior. :)

After investigating the scenario more thoroughly it seems the behavior we generate when using our EUI feature is correct. Your custom action error is thrown on a dialog in sequence (TestDialog) which executes after the "ProgressDlg" dialog in sequence. Thus the "TestDialog" is displayed after the effective installation process ends.

All the installation files are deployed during the progress of "ProgresDlg" dialog, also at this stage the product is registered. After this stage no error will actually trigger an installation rollback. Thus triggering the "FatalError" dialog with the following error message

Code: Select all

Your application setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.
is not correct. Actually if you run the setup package second time you will see it enters in maintenance mode and that the product is registered in Control Panel. This is why we do not want to display the "FatalError" dialog, because it would present to the user misleading info in this case.

When the EUI feature is not used the "FatalError"dialog is thrown by Windows Installer, but in our opinion this is a wrong behavior design, because at this stage the product was already successfully installed and registered.

Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”