Innosetup Package EXE install application and add Uninstall icon to go

Source: Internet
Author: User

http://blog.csdn.net/guoquanyou/article/details/7445773

Innosetup is really a great tool. The impression that I have is very lean. So, the tool has taken my installervise to the next step. The best thing about Innosetup is his scripting language, the full Pascal syntax, You can save a lot of trouble when you study him.
With Innosetup The wizard has been able to do a lot of work, but not perfect. Many places you have to make your own, this will use the script.

The default packaged program does not have an uninstall icon in the Program menu, which is not very good. You have to uninstall the program through the Add/Remove Programs to complete, this is too much trouble. In fact, it takes only a few steps to complete the work.

; The script is generated by the Inno Setup Script Wizard!
; For more information about creating a Inno Setup script file, check out the Help documentation!


#define MYAPPNAME "Qingdao Recruitment Network"
#define Myappversion "1.5"
#define Myapppublisher "Qingdao Recruitment Network"
#define MYAPPURL "http://www.qk12333.com/"
#define MYAPPEXENAME "Client.exe"

[Setup]
; Note: The value of AppID identifies the application individually.
; Do not use the same AppID value for the other setup programs.
; (Generate a new GUID, click Tools | Build the GUID in the IDE.) )
APPID={{E8EA32EC-AE79-4184-A374-4356A6BDBC16}
appname={#MyAppName}
appversion={#MyAppVersion}
; appvername={#MyAppName} {#MyAppVersion}
apppublisher={#MyAppPublisher}
apppublisherurl={#MyAppURL}
appsupporturl={#MyAppURL}
appupdatesurl={#MyAppURL}
defaultdirname={pf}\{#MyAppName}
defaultgroupname={#MyAppName}
Outputbasefilename=setup
Compression=lzma
Solidcompression=yes
Uninstallable=yes
Uninstalldisplayname= Uninstall {#MyAppName}


[Languages]
Name: "Chinesesimp"; Messagesfile: "COMPILER:DEFAULT.ISL"

[Tasks]
Name: "Desktopicon"; Description: "{Cm:createdesktopicon}"; Groupdescription: "{cm:additionalicons}"; flags:unchecked; onlybelowversion:0,6.1

[Files]
Source: "C:\Client.root\Client\bin\Debug\Client.exe"; DestDir: "{app}"; Flags:ignoreversion
Source: "C:\Client.root\Client\bin\Debug\AxInterop.WMPLib.dll"; DestDir: "{app}"; Flags:ignoreversion
Source: "C:\Client.root\Client\bin\Debug\Client.exe"; DestDir: "{app}"; Flags:ignoreversion
Source: "C:\Client.root\Client\bin\Debug\Client.pdb"; DestDir: "{app}"; Flags:ignoreversion
Source: "C:\Client.root\Client\bin\Debug\Interop.WMPLib.dll"; DestDir: "{app}"; Flags:ignoreversion
; Note: Do not use "flags:ignoreversion" on any shared system files
[Code]
function Initializesetup:boolean;
var Isbl:boolean; declaring variables
var isstr:string;
Global variables
var Myprogchecked:boolean;
var path:string;
Resultcode:integer;
Begin
If Regkeyexists (HKLM, ' software\microsoft\. netframework\policy\v2.0 ') Then
Begin
Result: = true;
End
Else
Begin
If MsgBox (' system detects that you are not installing. Net Framework2.0, do you want to download and install it now? ', mbconfirmation, mb_yesno) = Idyes Then
Begin
Path: = Expandconstant (' {pf}\internet explorer\iexplore.exe ');
Exec (Path, ' Http://data.zhiluo.net/soft/Microsoft_DotNet2.0.rar ', ' ', SW_SHOWNORMAL, ewwaituntilterminated, ResultCode);
MsgBox (' Please install the. Net Framework2.0 Environment, then run this installation package! ', MBINFORMATION,MB_OK);
Result: = false;
End
Else
Begin
MsgBox (' No. Net Framework2.0 Environment installed, unable to run the program, this installer is about to exit! ', MBINFORMATION,MB_OK);
Result: = false;
End
End

Begin//Start
ISBL: = true; Variable assignment Note the "Software\it_soft" below is consistent with the registry information created at installation
ISSTR: = ' welcome ';
If Regvalueexists (HKEY_LOCAL_MACHINE, ' software\it_soft ', ' config ') then
Begin
MsgBox (' software has been installed, if you need to reinstall, please uninstall and install! ', mbconfirmation, MB_OK);
ISBL: = false;
End
Else
Begin
MsgBox (' No value ', mbconfirmation, MB_OK);
ISBL: = true;
End
Result: = ISBL;
End End
End

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks:desktopicon
Name: "{group}\ uninstall {#MyAppName}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:launchprogram,{#StringChange (myappname, ' & ', ' && ')}}"; Flags:nowait Postinstall skipifsilent

Innosetup Package EXE install application and add Uninstall icon to go

Related Article

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.