kvmvehicle.blogg.se

Inno setup kill process before install
Inno setup kill process before install





inno setup kill process before install

If you really need to send a WM_CLOSE message to a window, then the support function FindWindowByWindowName() won't work. Ask them in a loop whether to cancel or to repeat the check, and do not continue unless all interfering programs are closed. What you should do instead: Check whether any program is open that interferes with the normal progress of your installation, and if one is found alert the user that they need to close it. Consider the case of Internet Explorer, the user may have some web pages open with forms partially filled in - if you close them unconditionally you may actively piss off the user because they lost work. It's a bad idea to close any program without asking the user first.

inno setup kill process before install

Your code makes several assumptions that are wrong, and you should address them all: WbemObject := WbemObjectSet.ItemIndex(0) If not VarIsNull(WbemObjectSet) and (WbemObjectSet.Count > 0) then

inno setup kill process before install

WbemObjectSet := WMIService.ExecQuery('SELECT * FROM Win32_Process Where Name="' + AppName + '"') WMIService := WbemLocator.ConnectServer('localhost', 'root\CIMV2') WbemLocator := CreateOleObject('WbemScripting.SWbemLocator') 'notepad.exe': const wbemFlagForwardOnly = $00000020 Version with use of Win32_Process, you call the procedure with i.e.







Inno setup kill process before install