mat_bruges
Posts: 33
Joined: Tue Mar 11, 2008 12:28 am

Parse search property to produce install folder

Hi,

In my Merge Module I need to look up a value in the registry which contains (among other things) a file path. I need to parse this value until I get the file path, and based on that I need to construct a new folder name.

Here's what I have done so far, based on this example: http://www.advancedinstaller.com/user-g ... older.html

1. Created a registry search and called it FM_OPEN_CMD. This is the property that contains the file path and that I need to parse.
2. Created a property called FM_EXT_FOLDER, with a value "Your Value". This value should be set by the VBS action.
3. Created a target location also called FM_EXT_FOLDER, pointing to the property FM_EXT_FOLDER
4. Added a script called "GetFMFolder" to the "AppSearch" action.

This line in the script reads the value of the registry search property:
fmCommand = Session.Property("FM_OPEN_CMD")

The script then parses that string and produces a new folder name. This line in the script sets that folder name to the property:
Session.Property("FM_EXT_FOLDER") = fmFolder

I have added some debug messages to my script, and it seems that the variable "fmCommand" is always empty. So the rest of my script does not work either since I'm not getting the correct input.

I have tried various other custom action events since I figured that the registry search had not yet been performed, but it is still always empty. What am I doing wrong?

Thanks

Mat
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Parse search property to produce install folder

Hi,

I'm not sure why the property isn't retrieved correctly. Perhaps the search is not configured correctly or it doesn't find the value. If the problem persists please send us the .AIP you are using to support at advancedinstaller dot com so we can investigate it. Also, please attach a verbose log of the install process.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mat_bruges
Posts: 33
Joined: Tue Mar 11, 2008 12:28 am

Re: Parse search property to produce install folder

Thanks Cosmin, I just emailed you the files.

Regards

Mat
mat_bruges
Posts: 33
Joined: Tue Mar 11, 2008 12:28 am

Re: Parse search property to produce install folder

I fixed it!

There were 2 things that I had to change to make it work:

1) I noticed the log file specifies the property with the GUID of the merge module. I tried to access it that way instead:

fmCommand = Session.Property("FM_OPEN_CMD.86FB4E42_433F_4DF2_B118_B3E1B8A91675")

2) I had to declare the script variable like this:

Dim frmCommand

I thought this was only necessary if you used "Option explicit", it seems to work OK for the other script variables. But apparently for the session properties it is required.

Regards

Mat

Return to “Common Problems”