Hi,
At the search time the APPDIR property is not available because this property is resolved on "CostFinalize" standard action. In previous post I was sugesting conditioning the installation based on the result of a search (search performed in all directory structure from local computer by leaving the "Path" field empty).
3. custom action
under InstallExecuteSequence
under AppSearch
new action : Property Set with Formatted
property name: RESULT_PROPERTY
formatted Text: [RESULT_PROPERTY]
This type of custom action sets a property from a formatted text string, so in the way that you use this custom action has no effect.
I do this by checking if a file exists in the folder they want to install the application
From what you say I understand that there is no problem if the application is installed multiple times on the same network drive but in different locations. In this case the file search does not work. Here's how you can do this:
1. Schedule a "New Attached Custom Action" under the "InstallExecuteSequence->Begin".
2. Set as "Function Name" the function name in the script file ("Test").
3. Execution Properties: Synchronous execution, check return code
4. Execution Options: Immediate execution
5. Scheduling Options: Always Execute
6. Execution condition: Not Installed
I have modified your script in order to work:
Code: Select all
Function Test
Set fs = CreateObject("Scripting.FileSystemObject")
if fs.fileexists(session.property("APPDIR") & "ICTool.MDB") then
MsgBox "The ICTool was already installed in another computer, please use the Install for Workstations to setup the tool in your computer. Aborting", vbCritical+vbOKOnly, "IC Tool Setup"
Test = 3
End if
End Function
If the file is found the function returns 3 to indicate that the installation must be aborted.
Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com