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!

Alex WK
Posts: 3
Joined: Wed Feb 10, 2016 4:48 pm

Installation Successfully Completed

Hi All,

is there a Property or something that can be evaluated to be sure the installation has been successfully completed?
I'm creating a custom action in order to create a shortcut on the user's Desktop when the installation begin, (the shurtcut's target is the web Url of the Setup file published).
Than I want to delete this shoutcut only if the installation has successfully completed.

With this trick I want to cover the scenario who see the user aborts the installation and He didn't know where the setup is located.
The user could ignore the setup file location because the setup will be processed by an automated process inside his running application.
Alessandro Serranò
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Installation Successfully Completed

Hi Alessandro and welcome to Advanced Installer forums,

If you want to be sure that the application was successfully installed when your custom action will be executed, then you can execute the custom action on the last dialog, ExitDialog. To see how you can execute the custom action on a custom trigger from a dialog (e.b. Finish button), please take a look on the How to execute a custom action when a button is pushed? article.

Note that if the user will cancel the installation or an error will occur during installation the user will not be prompted with the ExitDialog at the end of the installation process. In this case, the user will be prompted with the UserExit dialog or FatalError dialog.

Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Alex WK
Posts: 3
Joined: Wed Feb 10, 2016 4:48 pm

Re: Installation Successfully Completed

Hi Dan,

before your reply I used to put the Custom action with Sequence after the "Finish Execution" Stage.
But I presume this method doesn't ensure the action will be execute only when the installation has been successfully completed.

Now I tried to adopt your solution, but I cant adopt it, because I created an installation package without user interaction, setting "Basic UI with progress" in the Bootstrap section, and setting Modal to "False" in all Dialogs.

Than there are no buttons configured the user should press at the end

How can I Archive the target?

just How I'm thinking to set a condition to the custom action in sequence linked to the registry keys that I aspected should be present when the installation has been successfully completed, for example: HKEY_CURRENT_USER\SOFTWARE\<Manufacter>\<ProductName>_< ProductVersion>

Could works?

Thanks
Alessandro Serranò
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Installation Successfully Completed

Hi Alessandro,
before your reply I used to put the Custom action with Sequence after the "Finish Execution" Stage.
But I presume this method doesn't ensure the action will be execute only when the installation has been successfully completed.
Yes, this a valid approach. If any error will be encountered during installation, the rollback actions will be triggered. Your custom action will not be triggered since it is of immediate action.

You can read more about custom action in the Setting execution time for custom actions article.

Please let me know if you need any help.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Alex WK
Posts: 3
Joined: Wed Feb 10, 2016 4:48 pm

Re: Installation Successfully Completed

Unfortunately , there isn't a condition based on registry key check, than I included this check inside my inline powershell script but the if statement doesn't work.
this is my script to delete the shortcut (previously created at the begin of installation process with another script):

Code: Select all

#Get variables
$DesktopFolder = AI_GetMsiProperty DesktopFolder
$Reinstall_Link_Name = AI_GetMsiProperty Reinstall_Link_Name
$Manufacter = AI_GetMsiProperty Manufacter
$Country = AI_GetMsiProperty Country
$ProductName = AI_GetMsiProperty ProductName
$ProductVersion = AI_GetMsiProperty ProductVersion

#Set variables
$Reinstall_link = $DesktopFolder + $Reinstall_Link_Name + ".lnk"
$regkey_to_check = "HKCU:\Software\" + $Manufacter + "\" + $ProductName + "_" + $Country + "_" + $ProductVersion

##delete Reinstall shoutcut
if (Test-Path $regkey_to_check) {Remove-Item $Reinstall_link -Force}
If I remove the last "if statementent" the removal of shurtcut works.
I tested with a powershell console opened during the installation process in order to test the registrykey creation, it has created about the last step of the installtion process.

Any suggestions?
Alessandro Serranò

Return to “Building Installers”