Inno Setup Uninstall before exiting the process, deleting the folder

Source: Internet
Author: User

[Code]
function Initializeuninstall(): Boolean;varMainrun:hwnd;varMvrun:hwnd;begin
The findwindowbywindowname function parameter is the window name, which is the window caption, not the process name. Mainrun:= Findwindowbywindowname (' main Window'); Mvrun:= Findwindowbywindowname ('Connector');if (screenrun<>0) or (mvrun<>0 ) then BEGINifMsgbox ('Setup has detected that the client is running. '# -# - 'Click Yes to close the process, continue uninstalling, or press No to exit! ', mbconfirmation, Mb_yesno) =Idno THEN BEGIN Result:=false;// Setup ExitsEndElsebegin
if more than two judgment conditions are required, they should be judged separately at the time of execution .if screenrun<>0Then begin PostMessage (Mainrun, -,0,0);//exiting the main processend; if mvrun<>0Then begin PostMessage (Mvrun, -,0,0);//exiting the connector processend; deltree (Expandconstant ('{app}'), True, true, true); // Remove all folders from the installation location after exiting the process Result:=true;// The Setup program continuesend; EndElsebegin Result:=true; If no process is detected, continue to install the program end;end;

Inno Setup Uninstall before exiting the process, deleting the folder

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.