Hi,
This can be done by using an additional launch condition. Here are the steps:
- create a VBScript custom action which contains this code:
Code: Select all
Dim objWMIService, objProcess, colProcess
Dim strComputer
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")
For Each objProcess in colProcess
if objProcess.Name = "AdvancedInstaller.exe" then
Session.Property("PROCESS")="RUNNING"
End If
Next
- this is set for verifying if the "AdvancedInstaller.exe" process is running, therefore you need to modify it to find your process (replace "AdvancedInstaller.exe" in the code)
- in the "Custom Actions" page add this custom action as an Attached custom action under the "InstallUISequence" -> "FindRelatedProducts" standard action (just before the "LaunchConditions" standard action)
- you can see a standard action by using the "Show Standard Action" button on the toolbar
- make sure that in the "Custom Action Properties" page the "Function Name" field is empty (the rest of the settings are the default ones)
- since the PROCESS property needs to be initialized before searching the process, you go to "Install Parameters" page and create the PROCESS property with the value NOT RUNNING
- finally, go to the "Prerequisites" page and create this additional launch condition:
Code: Select all
PROCESS="NOT RUNNING" Advanced Installer is running, please close it before running the installation.
Let me know if you encounter any problems.
Regards,
Cosmin
FOLLOW US
Get the latest news in Application Packaging