Hello Jill and welcome to our forum!
A possible method would be searching for a file contained by the folder you are searching for and, after the file is found, the path containing the file should be extracted with a script.
This can be done by using the following steps:
1. Go to "Search" page and and create a new file search named "SEARCH_PROPERTY". You need to search for a file contained by the ENU Folder, for example "a.txt". Right click on "SEARCH_PROPERTY" and select "Add Location - Folder". Enter
[CommonAppDataFolder] as a path and "6" in "Depth" field.
This search will return "C:\ProgramData\Freedom Scientific\JAWS\17\Settings\ENU\a.txt".
2. Create a new "Set Installer Property" custom action with sequence and place it before "Searches" action group in "Wizard Dialogs Stage" and in "Install Execution Stage" too. Use this custom action to set
PATH property to a valid path, for example
[CommonAppDataFolder]. This step is necessary in case the file is not found by the search action.
3. Create a new "Execute Inline Script" custom action with sequence and place it after "Searches" action group in "Wizard Dialogs Stage" and in "Install Execution Stage" too. Use the following VBS code:
Code: Select all
'retrieve the file path from the search operation
filePath = Session.Property ("SEARCH_PROPERTY")
'if file is found on the target machine
If Len(filePath) > 0 Then
'retrieve folder path
folderPath = Left ( filePath, InStrRev (filePath, "\") - 1)
'set the installation path with this value
Session.Property ("PATH") = folderPath
End If
This code will extract the path from the "SEARCH_PROPERTY" result and place it to "PATH" property. In your case "PATH" will receive : "C:\ProgramData\Freedom Scientific\JAWS\17\Settings\ENU\"
4. Depending on your needs, set "PATH" property either as a
property based folder - to deploy some of your files in it or go to "Install Parameters" page set "Application folder" to
[PATH] to deploy all your files in it
Let us know if this helped.
All the best,
Daniel