cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Ahren_Gauthier
Level 2

Close a running process before installing?

I need to do a few things before installing:
1) Delete a file
2) Delete a registry entry
3) Send a key combo
4) End a process

Any ideas on how best to tackle this?

Thanks
Labels (1)
0 Kudos
(4) Replies
TheTraveler
Level 8

Hello,

Use "DeleteFile" to delete your file. You can use the the registry functions in install shield to delete your key. There several examples in the forum and in the help files. Not sure what "Send a key combo" is suppose to do.

You can use this to kill your process...
    hWnd = FindWindow("", "Name of your Process");
if hWnd != NULL then
PostMessage(hWnd, WM_CLOSE, 0, 0);
Endif;
0 Kudos
Ahren_Gauthier
Level 2

Thanks for the reply!

RE: "Key Combo":
The process that is running has an exe attached to it that automatically restarts the program if the process is terminated. There is a key combo -CTRL+ALT+Function Key - that disables the auto restart.

I suppose the question becomes: is there a way to simulate keyboard input?
0 Kudos
TheTraveler
Level 8

Not sure on how to do that in install shield script. I know you can do that in C++. You could write a C++ DLL have have it called from install shield script. That will work.

I do have a question about this process the respawns when it is killed. Is it a windows Service Task? If it is, you could use, "ServiceStopService". This function call will stop the service task.
0 Kudos
Christopher_Pai
Level 16

I would refactor the watchdog service to expose an API for enabling and disabling the launch. This sounds like a problem waiting to happen when trying to perform silent installs.
0 Kudos