Execute AppSearch/VBScript on APPDIR change - Advanced Installer Community

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!

Yoyo
Posts: 3
Joined: Fri Mar 16, 2012 2:55 pm

Execute AppSearch/VBScript on APPDIR change

I am creating the Installer for a ModPack of a game.
The APPDIR of the game is retrieved from the registry at the start of the installer by a vbscript and is then used as APPDIR by the installer.
Then the version number is parsed out of a xml-file located in APPDIR using an XML-Search.
During the Installation there's a text-field that shows the version number in the SetupTypeDlg, where the user can also edit the APPDIR.
Now I want to update the version-field when the user changes the APPDIR manually (e.g. because of multiple game versions installed) with the version in the xml, located in the user-chosen folder.
If there's no xml located in the user-chosen folder, a warning/error should appear.

Another way would be to show the game version on the VerifyReadyDlg and updating the VERSION Property with a Custom Action vbscript that gets executed between SetupTypeDlg and VerifyReadyDlg.

Now my question is:
Is there a solution that makes it possible to use the first way and if not, is there a Standard Action or sth else that gets executed between SetupTypeDlg and VerifyReadyDlg, so I can use the other way?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Execute AppSearch/VBScript on APPDIR change

Hello,
If there's no xml located in the user-chosen folder, a warning/error should appear.
You can add a search from the Search page to determine if the xml file exists. You can also use this predefined feature to retrieve any registry value.
is there a Standard Action or sth else that gets executed between SetupTypeDlg and VerifyReadyDlg
No standard action, but you can execute a custom action when the "Next" button is pressed by the user. Here's an article to help you with this:
How do I execute a custom action when a button is pushed?
The complete list of standard actions can be found here.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Yoyo
Posts: 3
Joined: Fri Mar 16, 2012 2:55 pm

Re: Execute AppSearch/VBScript on APPDIR change

mihai.petcu wrote:You can add a search from the Search page to determine if the xml file exists. You can also use this predefined feature to retrieve any registry value.
Hmm but AFAIK I cannot execute another AppSearch in the mid of the installation..
Also I cannot use the registry value found by an AppSearch in the other AppSearch, so I had to place it in a vbs that is executed earlier.
mihai.petcu wrote:No standard action, but you can execute a custom action when the "Next" button is pressed by the user. Here's an article to help you with this:
How do I execute a custom action when a button is pushed?
Ahh that's a good idea. I now only have the Problem that APPDIR is the old value while executing the vbs altough the Custom Action is executed after closing the browse dialog.
My script then parses the xml located at old path and doesn't use the new one... Why is APPDIR not updated after the BrowseDlg event finished ?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Execute AppSearch/VBScript on APPDIR change

Hi,
Hmm but AFAIK I cannot execute another AppSearch in the mid of the installation..
This is true, but although a search is performed at the beginning of the installation, its result will be stored in the search name public property and will be available throughout the installation.
Also I cannot use the registry value found by an AppSearch in the other AppSearch
This is unfortunately true because the search order is not guaranteed by Windows Installer.
Why is APPDIR not updated after the BrowseDlg event finished ?
APPDIR is set after "SetTargetPath" event on the "Next" button is published.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Yoyo
Posts: 3
Joined: Fri Mar 16, 2012 2:55 pm

Re: Execute AppSearch/VBScript on APPDIR change

mihai.petcu wrote:APPDIR is set after "SetTargetPath" event on the "Next" button is published.
Unfortunately the installer hangs when adding the SetTargetPath to the Browse Buttons Published Events...
So could I save the result of the BrowseDlg into another variable apart from APPDIR, so I can access it when I use a DoAction Event after the SpawnDlg Event? Or is the DoAction Event, altough placed after the SpawnDlg, executed before the BrowseDlg is closed, so it cannot use the path chosen in the BrowseDlg? Probably this makes the things I want to achieve a bit more clear:

Image

Edit: Seems that all events get executed immediately... This is a problem...
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Execute AppSearch/VBScript on APPDIR change

Hello,

Can you 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?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”