This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- IDABORT is not aborting installation in all scenarios when called in VB Script
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 03, 2010
02:45 PM
IDABORT is not aborting installation in all scenarios when called in VB Script
I am creating an Basic MSI installer.
I need to make sure that the application that I am installing is not currently running. In order to do so, I created a VBScript which checks whether the application is running or not. If the application is running, it displays a message box asking the user to close the application. The messagebox has two buttons Retry and Cancel. When Retry is clicked, I am calling same function recursively to verify that the user has closed the application. However if the user clicks cancel, I want to abort the installation.
If my Hello World.exe is running, it shows the message box with two buttons. If I close the application now and then click Retry again, it proceed with the installation.
However, Cancel seems not working correctly. If the message box is displayed very first time and user clicks 'Cancel', it aborts the installation. However if user clicks Retry (without closing the application) one or more time, and then afterward click Cancel, it doesn't abort the application.
Any suggestion what I am doing wrong.
I would appreciate any help. Thanks.
Here is the vbscript function CheckRunningProcess that I am calling from the custom action in my installer.
Function CheckRunningProcess()
Const IDABORT = 3
Dim Wmi, Wql, Processes
Set Wmi = GetObject("winmgmts:")
Wql = "select * from Win32_Process where name ='Hello World.exe'"
Set Processes = wmi.execquery(wql)
If Processes.Count > 0 Then
result = MsgBox ("Hello World is running. Please Close Hello World",vbRetryCancel+vbDefaultButton2,"Close Running Application")
If result = 4 Then
FindProcess()
ElseIf result = 2 Then
FindProcess = IDABORT
Else
FindProcess = IDABORT
End If
End If
End Function
I need to make sure that the application that I am installing is not currently running. In order to do so, I created a VBScript which checks whether the application is running or not. If the application is running, it displays a message box asking the user to close the application. The messagebox has two buttons Retry and Cancel. When Retry is clicked, I am calling same function recursively to verify that the user has closed the application. However if the user clicks cancel, I want to abort the installation.
If my Hello World.exe is running, it shows the message box with two buttons. If I close the application now and then click Retry again, it proceed with the installation.
However, Cancel seems not working correctly. If the message box is displayed very first time and user clicks 'Cancel', it aborts the installation. However if user clicks Retry (without closing the application) one or more time, and then afterward click Cancel, it doesn't abort the application.
Any suggestion what I am doing wrong.
I would appreciate any help. Thanks.
Here is the vbscript function CheckRunningProcess that I am calling from the custom action in my installer.
Function CheckRunningProcess()
Const IDABORT = 3
Dim Wmi, Wql, Processes
Set Wmi = GetObject("winmgmts:")
Wql = "select * from Win32_Process where name ='Hello World.exe'"
Set Processes = wmi.execquery(wql)
If Processes.Count > 0 Then
result = MsgBox ("Hello World is running. Please Close Hello World",vbRetryCancel+vbDefaultButton2,"Close Running Application")
If result = 4 Then
FindProcess()
ElseIf result = 2 Then
FindProcess = IDABORT
Else
FindProcess = IDABORT
End If
End If
End Function
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 08, 2010
03:59 PM
Can anybody suggest why its not working...
savy17 wrote:
I am creating an Basic MSI installer.
I need to make sure that the application that I am installing is not currently running. In order to do so, I created a VBScript which checks whether the application is running or not. If the application is running, it displays a message box asking the user to close the application. The messagebox has two buttons Retry and Cancel. When Retry is clicked, I am calling same function recursively to verify that the user has closed the application. However if the user clicks cancel, I want to abort the installation.
If my Hello World.exe is running, it shows the message box with two buttons. If I close the application now and then click Retry again, it proceed with the installation.
However, Cancel seems not working correctly. If the message box is displayed very first time and user clicks 'Cancel', it aborts the installation. However if user clicks Retry (without closing the application) one or more time, and then afterward click Cancel, it doesn't abort the application.
Any suggestion what I am doing wrong.
I would appreciate any help. Thanks.
Here is the vbscript function CheckRunningProcess that I am calling from the custom action in my installer.
Function CheckRunningProcess()
Const IDABORT = 3
Dim Wmi, Wql, Processes
Set Wmi = GetObject("winmgmts:")
Wql = "select * from Win32_Process where name ='Hello World.exe'"
Set Processes = wmi.execquery(wql)
If Processes.Count > 0 Then
result = MsgBox ("Hello World is running. Please Close Hello World",vbRetryCancel+vbDefaultButton2,"Close Running Application")
If result = 4 Then
FindProcess()
ElseIf result = 2 Then
FindProcess = IDABORT
Else
FindProcess = IDABORT
End If
End If
End Function
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)