Custom action on button and textfile update - Advanced Installer Community
Kratzer
Posts: 66
Joined: Wed Apr 10, 2013 5:36 pm

Custom action on button and textfile update

Hello,

I have the following problem:

In the folder dialog of the setup I have registered a custom action on the next button to set a property value with APPDIR and a specific file name, replacing all "\" to "\\" for a Unix Dev Environment.
On one file there is a text file update to replace a certain string in the file with the new property value.
After installing the software the string in the file is always replaced by the initial value of the property, not by the value created in the custon action.

- initial value of [Path_2_Win32exe] is "{unknown}"

- Custom action is VB script:

msgbox Session.Property("Path_2_Win32exe")
Session.Property("Path_2_Win32exe") = Session.Property("APPDIR") + "\MyFile.exe"
Session.Property("Path_2_Win32exe") = replace(Session.Property("Path_2_Win32exe"),"\\","\")
Session.Property("Path_2_Win32exe") = replace(Session.Property("Path_2_Win32exe"),"\","\\")
msgbox Session.Property("Path_2_Win32exe")

- In the first msgbox "{unknown}" is shown --> correct
- In the second msgbox for example "c:\\programs\\MyApp\\MyFile.exe" is shown --> correct

In the text file, where a replace action is configured with the text file update, the value "{unknown}" is set.

Can you Help?

We are using version 10.8

Best regards
Bernd
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom action on button and textfile update

Hello Bernd,

I'm not sure why you encountered this behavior. In order to have a better view about this, please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Kratzer
Posts: 66
Joined: Wed Apr 10, 2013 5:36 pm

Re: Custom action on button and textfile update

Hello Dan,

files are sent to support.

Best Regards,
Bernd
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom action on button and textfile update

Hi Bernd,

This is happening because the Path_2_Win32exe is a Private property (contain lower-case letters in their name, example: My_Prop). So, you need to define the related property as a Public property (contain only upper-case letters in their name, example: MY_PROP)

The difference between Private and Public Properties consists in the way their values are being passed on. The value of a Public Property is passed on from the Wizard Dialogs Stage (in which the dialogs are showed) to the Install Execution Stage (in which the system is modified).
Therefore, make sure that you use a Public Property for an UI control (Editbox, Combobox etc) if you want its value to be available in the InstallExecute Sequence (for instance, if the value of this Property is written in the text file update).

Please take a look on the Properties article which may be useful to you.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Kratzer
Posts: 66
Joined: Wed Apr 10, 2013 5:36 pm

Re: Custom action on button and textfile update

Hi Dan,

thank you very much for your reply. Merry Xmas and and a happy new year to all of the AI team, great tool!

Best Regards,
Bernd
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Custom action on button and textfile update

You're welcome Bernd,

I'm glad you got this working. Merry Christmas and a Happy New Year for you too!

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”