Page 1 of 1

Error when cancelling installation

Posted: Thu Jan 05, 2012 8:36 am
by RolandA
What I do:
1. Start installer
2. Complete the first dialogs (e.g. destination, license check, etc.)
3. On the progress dialog, when copying the files, I click Cancel
--> Error dialog "Unable to copy installation data to local folders"

Is that the expected result or a bug? It's not that the message is wrong as such, but it's weird to display an alert for what the user invoked as intended action.
Can I fix this or customize the text?

Re: Error when cancelling installation

Posted: Fri Jan 06, 2012 3:27 pm
by giaviv
Hi,

That is not a bug - that message alerts you that the setup has been canceled and it is not going to go through.

Re: Error when cancelling installation

Posted: Mon Jan 09, 2012 3:27 am
by RolandA
Many thanks for your quick and useful reply.

Let me add that I'd like to see simply a nicer text in future versions.
Users are being accustomed to user-centric design and the message "Installation of <Title> cancelled successfully" may not be a big change, but offers a friendlier and more reassuring user experience.

Re: Error when cancelling installation

Posted: Mon Jan 09, 2012 10:53 pm
by giaviv
Thank you for your input!

Re: Error when cancelling installation

Posted: Thu Jan 03, 2013 7:46 pm
by Mike.Kelly
After the Error dialog "Unable to copy installation data to local folders" is closed, the setup exits. My MSICode is not given a chance to do any post-cancel clean-up.

Normally, if the user clicks Cancel, this is reflected in the Apply Changes variable, and the line following Apply Install can branch accordingly if the variable is set to the value CANCEL.

But in this particular scenario, this does not happen. The installer simply exists.

Why is that, and what can I do to get my code to run in this case?

Re: Error when cancelling installation

Posted: Fri Jan 04, 2013 6:55 am
by FrancescoT
Dear User,

Apply changes should return the following values;

CANCEL Installation was cancelled by the user.
COMPLETE Installation was completed successfully.
ERROR An error occured during installation. The error description is available in the LASTERROR variable.
REBOOT Installation was completed successfully, however a reboot is required.

have you verified which is the value of your result variable?

Regards

Re: Error when cancelling installation

Posted: Sun Jan 06, 2013 2:15 pm
by Mike.Kelly
Hi Francesco.

The scenario described in this post results in the install script being aborted prematurely. My code never gets a chance to query the return value from Apply Changes, because after the Error dialog "Unable to copy installation data to local folders", the installer exits. No further code in my script is called.

Cheers,
Mike

Re: Error when cancelling installation

Posted: Tue Jan 08, 2013 6:18 am
by FrancescoT
Dear Mike

This is by design.

The InstallAware setup wizard itself can handle aborts no matter where they occur. This was made possible when going from InstallAware 8 to InstallAware 9 by introduction of a new pre-defined script variable called ABORTONERROR:

Initially TRUE. Set this variable to FALSE if you still need the MSIcode script to continue executing in order to perform any custom logic when a low-level setup error (such as a web media block download error) or a user abort occurs. You should exercise care in overriding the default value of this variable. For instance, when a web media block download fails, setup normally aborts; if setup is permitted to continue after a web media block download failure, certain plug-in calls in the corresponding web media block region may fail, violating any assumptions you may have made about script execution. This variable is distinct from the variable ABORT in that while ABORT exclusively signals user cancellation, this variable signals any kind of setup cancellation or error, including low-level setup errors that are innate to the setup engine.


PLEASE NOTE!
Based on where the cancellation was trapped, you may get COMPLETE from the Apply Install - as the help indicates, you should be very careful with ABORTONERROR=FALSE as it is a low level override and may require manual cleanup in some edge cases.


Regards

Re: Error when cancelling installation

Posted: Tue Jan 08, 2013 3:40 pm
by Mike.Kelly
Ok.

My script contains about a hundred "Install Files" commands before the "Apply Install" command. It seems that the first "Install Files" triggers IA to unpack all files from the installer package. The scenario described in this post is easily reproduced by clicking Cancel during this unpacking phase.

To solve this problem, do I put "Set Variable ABORTONERROR to FALSE" before the first "Install Files" command, or directly before "Apply Install"?

Once that's there, can I examine the ABORT variable to determine if the user clicked Cancel?
If yes, when would I examine this variable? Immediately after the first "Install Files", or immediately after "Apply Install"?

Thanks.

Re: Error when cancelling installation

Posted: Wed Jan 09, 2013 8:03 am
by FrancescoT
Dear Mike,

you should initialize the ABORTONERROR variable at the very beginning of your script.

Then you have to check the ABORTEDONERROR pre-defined variable (.. and the returned value from Apply Install as well) just after the Apply Install command.

Also, I suggest you to have a look at the InstallAware documentation about the above variables and don't forget, the use ABORTONERROR variable causes a low level override and may require manual cleanup in some cases.

Regards