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
- :
- Re: Closing the related applications pre-installation
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 28, 2008
12:17 PM
Closing the related applications pre-installation
I have a plug-in application and I need to close the applications like Outlook, Word, IE, etc before I start installing the applications. How can I do it in InstallShield means?
9 Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 07, 2009
03:55 PM
You might try the following script
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = "Outlook.exe"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = "Outlook.exe"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2009
07:32 AM
Thanks, but I need to make a clarification: my installer needs to ask user to close the apps rather then killing the processes silently. FilesInUse dialog doesnt pick up my the applications I want.
Is there a way to explicitly pass the applications to FilesInUse dialog to show the applications needs to be closed?
Is there a way to explicitly pass the applications to FilesInUse dialog to show the applications needs to be closed?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 08, 2009
09:10 AM
Searching the MSI help for "FilesInUse" and "InstallValidate" will turn up some leads. Please also see [thread=171533]this thread[/thread] on a similar question.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2009
08:24 AM
RobertDickau wrote:
If you have the name of the EXE to shut down and its process ID, something like this before InstallValidate seems to work in VBScript:Set myrec = Installer.CreateRecord(2)
myRec.StringData(1) = "SampleApp.exe"
myRec.IntegerData(2) = 4321
Session.Message &H05000000, myrec ' msiMessageTypeFilesInUse, that is
It doesn't seem to respect the Exit button, but perhaps it's a start...
Thanks Robert, I am doing everything in a C++ dll. And I got to the same point that you advised above and observed the same that the buttons (retry and exit) are not respected. Any further suggestions how to get around this?
On another note, if there is no window for the process, it gives this error "Window could not be found. Process ID: 4300". So could you think of something that could cover the processes with no windows as well?
Thanks very much!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2009
04:45 PM
On thing I noticed on this is that once I send the FilesInUse message;
custom action doesnt execute the next line until I hit a button on the FilesInUse dialog. Why custom action is hanging there? I want the custom action to continue executing later lines after the line above. Could you suggest how I can do that?
Also, in order to get the Retry and Exit buttons respected, I am planning to put Actions for them as well.
Thanks much!
MsiProcessMessage(ghMsi, INSTALLMESSAGE(INSTALLMESSAGE_FILESINUSE), hRecord);
custom action doesnt execute the next line until I hit a button on the FilesInUse dialog. Why custom action is hanging there? I want the custom action to continue executing later lines after the line above. Could you suggest how I can do that?
Also, in order to get the Retry and Exit buttons respected, I am planning to put Actions for them as well.
Thanks much!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2009
03:16 AM
Another note, the only log printed after I call MsiProcessMessage function is this:
MSI (c) (40:E4) [08:43:18:128]: Note: 1: 2262 2: ListBox 3: -2147287038
and everything stops there, until I hit some buttom on the dialog.
MSI (c) (40:E4) [08:43:18:128]: Note: 1: 2262 2: ListBox 3: -2147287038
and everything stops there, until I hit some buttom on the dialog.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2009
03:24 PM
The pause is presumably MsiProcessMessage waiting for a button click so it can return the constant (IDRETRY, IDIGNORE, IDCANCEL?) indicating the button the user clicked.
Regarding windowless processes, that behavior is documented in the MSI topic "Sending Messages to Windows Installer Using MsiProcessMessage", the idea being that the user wouldn't generally know how to shut down a windowless process.
Regarding windowless processes, that behavior is documented in the MSI topic "Sending Messages to Windows Installer Using MsiProcessMessage", the idea being that the user wouldn't generally know how to shut down a windowless process.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 16, 2009
04:13 AM
Excellent! Thanks much, Robert!
One (hopefully) last question on this, so if MsiProcessMessage returns IDCANCEL, how can I tell the msi to exit the installation gracefully?
One (hopefully) last question on this, so if MsiProcessMessage returns IDCANCEL, how can I tell the msi to exit the installation gracefully?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 16, 2009
08:55 AM
The typical way is for your custom action function to return ERROR_INSTALL_FAILURE.
