Innosetup Full Script

Source: Internet
Author: User
Tags log4net

#define MYAPPNAME "Somarto"
#define Myappversion "1.0.0"
#define Myapppublisher "XXXXXX Co., Ltd."
#define MYAPPURL "http://www.XXX.cn/"
#define MYAPPEXENAME "Somarto.exe"
#define Myappreguninstall "Software\microsoft\windows\currentversion\uninstall\"
[Setup]
APPID={{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}
appname={#MyAppName} {#MyAppVersion}
appvername={#MyAppName} {#MyAppVersion}
apppublisher={#MyAppPublisher}
apppublisherurl={#MyAppURL}
appsupporturl={#MyAppURL}
appupdatesurl={#MyAppURL}
Defaultdirname={pf}\somarto
Versioninfocopyright=copyright @ 2011-2018 XXX. All Rights Reserved
defaultgroupname={#MyAppName}
Outputdir=d:\ckm\somarto\setup
Outputbasefilename=somarto-64
Setupiconfile=d:\ckm\somarto\style\dns32.ico
Compression=lzma
Solidcompression=yes
Architecturesallowed=x64
Architecturesinstallin64bitmode=x64
[Languages]
; Name: "Chinesesimp"; Messagesfile: "COMPILER:DEFAULT.ISL"; Name: "中文版"; Messagesfile: "COMPILER:LANGUAGES\ENGLISH.ISL"
Name: "Englishsimp"; Messagesfile: "COMPILER:DEFAULT.ISL"
[Tasks]
Name: "Desktopicon"; Description: "{Cm:createdesktopicon}"; Groupdescription: "{cm:additionalicons}"; Flags:checkablealone;
Name: "Quicklaunchicon"; Description: "{Cm:createquicklaunchicon}"; Groupdescription: "{cm:additionalicons}"; Flags:checkablealone

[Files]
Source: "D:\CKM\Somarto\bin\Debug\Somarto.exe"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\SomartoGame.exe"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Coding4Fun.Kinect.WinForm.dll"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Coding4Fun.Kinect.Wpf.dll"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Fleck.dll"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\FluorineFx.dll"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Fx.config"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Somarto.exe.config"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Kinect.Services.dll"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Kinect.Toolbox.dll"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\log4net.config"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\log4net.dll"; DestDir: "{app}"; Flags:ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\sys.ini"; DestDir: "{app}"; Flags:ignoreversion
Source: "d:\ckm\somarto\style\*"; DestDir: "{app}"; Flags:ignoreversion Recursesubdirs Createallsubdirs; Source: "* *"; DestDir: "{app}"; Flags:recursesubdirs Createallsubdirs; Beforeinstall:changedisplay
; Note: Do not use "flags:ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:uninstallprogram,{#MyAppName}}"; Filename: "{Uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks:desktopicon

[Registry]
ROOT:HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; valuetype:string; ValueName: "Somarto"; Valuedata: "{App}\somarto.exe"; Flags:uninsdeletevalue
; ROOT:HKLM; Subkey: "Software\somarto"; valuetype:string; ValueName: "Install"; Valuedata: "{app}"; Flags:uninsdeletevalueRoot:HKLM; Subkey: "Software\microsoft\windows\currentversion\uninstall\{#MyAppName}"; valuetype:string; ValueName: "UninstallString"; Valuedata: "{App}\unins000.exe"; Flags:uninsdeletekey
[Code]
Var
Hasrun:hwnd;
Resultcode:integer;
resultstr:string;
function Initializesetup (): Boolean;
Begin
Result: = True;
Begin
If Regkeyexists (HKLM, ' {#MyAppRegUninstall}{a08292bb-197a-4dae-a8e9-7d27155ad8a9}_is1 ') then
Begin
If MsgBox (' Setup has detected a version of ' Somarto ' installed. ' #13 # # ' Select Yes to overwrite the installation. ' #13 # # ' select ' No ' to exit Setup and discard the installation. ', mbconfirmation, mb_yesno) = Idyes Then
Begin
Hasrun: = Findwindowbywindowname (' Somarto ');
while (hasrun <> 0) do
Begin
MsgBox (a version of ' Somarto ' is running, ' #13 # # ' application will automatically exit. ', mbconfirmation, MB_OK);
PostMessage (hasrun,18,0,0);
Sleep (3);
Hasrun: = 0;
End
Result: = True;
End Else
Begin
Result: = False;
Exit
End
End
End

Begin
If Regquerystringvalue (HKLM, ' {#MyAppRegUninstall}{a08292bb-197a-4dae-a8e9-7d27155ad8a9}_is1 ', ' uninstallstring ', RESULTSTR) Then
Begin
ResultStr: = Removequotes (RESULTSTR);
Exec (ResultStr, '/verysilent ', ', Sw_hide, ewwaituntilterminated, ResultCode);
End
End

End


Procedure Initializewizard ();
Begin
Begin
WizardForm.WizardSmallBitmapImage.Top: = ScaleY (0);
WizardForm.WizardSmallBitmapImage.Left: = ScaleX (0);
WizardForm.WizardSmallBitmapImage.Width: = WizardForm.MainPanel.Width;
WizardForm.WizardSmallBitmapImage.Height: = WizardForm.MainPanel.Height;
wizardform.pagenamelabel.width:=40; Set the size of the caption text display
Wizardform.pagedescriptionlabel.width:= 230; Set the size of the caption text display

End
End


function Initializeuninstall (): Boolean;
Begin
Begin
Hasrun: = Findwindowbywindowname (' Somarto ');
If Hasrun<>0 Then
Begin
MsgBox (' Somarto ' application is running. ' #13 # # ' Please exit your application before uninstalling. ', mbinformation, MB_OK);
Result: = false;
Exit
End
End
Begin
deltree (Expandconstant (' {app} '), True, true, true);
Regdeletekeyincludingsubkeys (HKEY_CURRENT_USER, ' SOFTWARE\ICC ');
End
Result: = true;
End

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

Innosetup Full Script

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.