sonda
Posts: 90
Joined: Mon Apr 30, 2018 12:01 pm

Open url from property filled from script

Tue Sep 14, 2021 10:00 am

I have property OPEN_APP_URL with some default value (http://google.com), on upgrade I have a custom action that read the file and with AI_SetMsiProperty OPEN_APP_URL $OpenAppUr i fill the property with reading URL. on Exit dialog on Finish button i have a custom action that calls OpenUrl custom action but default URL always open not url filled in with new value. (also tied to set the property as persistent but no luck).

Not sure what i'm doing wrong with this property, why is not filled with the right value. (I have attached sample project and this is connected with a previously asked question https://www.advancedinstaller.com/foru ... =5&t=49434 because this open url should be filled on Update)

Regards
Attachments
mytest.zip
(19.48 KiB) Downloaded 105 times

Liviu
Posts: 145
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Open url from property filled from script

Tue Sep 14, 2021 3:17 pm

Hi,
Not sure what i'm doing wrong with this property, why is not filled with the right value.
To affect a property used in a condition on a component or feature, the custom action must come before the "Paths Resolution" action group from "Install Execution Stage". Your custom action which changes the value of the property was after the "Finish Execution" stage.

Just move your "PowerShellScriptInline" custom action before "Paths Resolution":
customAction.png
customAction.png (24.06 KiB) Viewed 4719 times
Also, delete the "Open URL" custom action from the "Published events" of the "Finish" button in the "Dialogs" page --> "Exit" dialog.

Now add a "Open URL" custom action with sequence after the "Finish Execution" stage and configure it like this:
openURL.png
openURL.png (62.84 KiB) Viewed 4719 times
Attached is your sample project with the above modification. After I tested this, the localhost URL saved from the first version of installation was launched.

Let me know if that helped!

Best regards,
Liviu
Attachments
mytestv2.aip
(45.6 KiB) Downloaded 103 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

sonda
Posts: 90
Joined: Mon Apr 30, 2018 12:01 pm

Re: Open url from property filled from script

Thu Sep 16, 2021 3:55 pm

Thanks, Liviu

for your detailed explanation also for pointing to this
To affect a property used in a condition on a component or feature, the custom action must come before the ...
I have probably forgotten or did not pay attention while read documentation to this but now I will have in mind.

Another thing why I'm placing OpenUrl on the finish button is because if I place in Install execution ->finish the stage, before (in the official installer this was the only example) open URL I have a script that checking and waiting services to be run and in Open URL is executed before the previous script ends and I have situation service is not jet ready but open URL script is executed.

Many thanks for your detailed examples it was of great help also notice about affection property that is used in condition.

Regards

Liviu
Posts: 145
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Open url from property filled from script

Fri Sep 17, 2021 2:01 pm

You are always welcome!

Please let us know if there is anything else we could help you with and we will gladly assist.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”