Inno Setup 5.22安装脚本示例

[Setup]
;应用程序的标题,显示在安装屏幕的左上角以及安装向导中
AppName=Inno Setup
汉化增强版
;应用程序的标题,包含程序的版本号
AppVerName=Inno Setup 5.2.2
汉化增强版
;默认开始菜单文件夹名
DefaultGroupName=Inno Setup
汉化增强版
;选择目标位置向导面中的默认目录名
DefaultDirName={pf}/Inno Setup
5
;安装程序编译器将生成的.EXE文件输出目录
OutputDir=./
;生成的安装程序文件名字
OutputBaseFilename=InnoSetup_522_HA
;固实压缩
SolidCompression=yes
Compression=lzma/max
;是否显示一个不创建任何图标选择框
AllowNoIcons=yes
InfoBeforeFile=embedded/InfoBefore.txt
WizardImageFile=embedded/dreams8.bmp
WizardSmallImageFile=embedded/dreams8smallimage.bmp
SetupIconFile=embedded/dreams8.ico
UninstallDisplayIcon=embedded/dreams8.ico
;备注版本信息
VersionInfoCompany=HTTP://DREAMS8.COM
VersionInfoDescription=Inno
Setup 汉化增强版
VersionInfoVersion=5.2.2.0
VersionInfoCopyright=Copyright (C)
2006-2007 似水年华
Encryption=true
Password=http://www.dreams8.com

[Files]
Source: Dreams8.CoM; DestDir: " "; Flags: dontcopy
Source:
{app}/JanHKill.exe; DestDir: {app}; Flags: ignoreversion
Source:
{app}/psvince.dll; DestDir: {app}; Flags: ignoreversion noencryption
Source:
{app}/Compil32.exe; DestDir: {app}; Flags: ignoreversion
Source:
{app}/Default.isl; DestDir: {app}; Flags: ignoreversion
Source:
{app}/isbunzip.dll; DestDir: {app}; Flags: ignoreversion
Source:
{app}/isbzip.dll; DestDir: {app}; Flags: ignoreversion
Source:
{app}/ISCC.exe; DestDir: {app}; Flags: ignoreversion; Check: not
IsISPP('ISCC.exe')
Source: {app}/ISCmplr.dll; DestDir: {app}; Flags:
ignoreversion; Check: not IsISPP('ISCmplr.dll')
Source: {app}/ISCrypt.dll;
DestDir: {app}; Flags: ignoreversion
Source: {app}/ISetup.hlp; DestDir:
{app}; Flags: ignoreversion
Source: {app}/ISetup.chm; DestDir: {app}; Flags:
ignoreversion
Source: {app}/isfaq.htm; DestDir: {app}; Flags:
ignoreversion
Source: {app}/islzma.dll; DestDir: {app}; Flags:
ignoreversion
Source: {app}/isunzlib.dll; DestDir: {app}; Flags:
ignoreversion
Source: {app}/iszlib.dll; DestDir: {app}; Flags:
ignoreversion
Source: {app}/license.txt; DestDir: {app}; Flags:
ignoreversion
Source: {app}/Setup.e32; DestDir: {app}; Flags:
ignoreversion
Source: {app}/SetupLdr.e32; DestDir: {app}; Flags:
ignoreversion
Source: {app}/whatsnew.htm; DestDir: {app}; Flags:
ignoreversion
Source: {app}/WizModernImage-IS.bmp; DestDir: {app}; Flags:
ignoreversion
Source: {app}/WizModernImage.bmp; DestDir: {app}; Flags:
ignoreversion
Source: {app}/WizModernSmallImage-IS.bmp; DestDir: {app};
Flags: ignoreversion
Source: {app}/WizModernSmallImage.bmp; DestDir: {app};
Flags: ignoreversion
Source: {app}/Examples/64Bit.iss; DestDir:
{app}/Examples; Flags: ignoreversion
Source:
{app}/Examples/64BitThreeArch.iss; DestDir: {app}/Examples; Flags:
ignoreversion
Source: {app}/Examples/64BitTwoArch.iss; DestDir:
{app}/Examples; Flags: ignoreversion
Source:
{app}/Examples/CodeAutomation.iss; DestDir: {app}/Examples; Flags:
ignoreversion
Source: {app}/Examples/CodeClasses.iss; DestDir:
{app}/Examples; Flags: ignoreversion
Source: {app}/Examples/CodeDlg.iss;
DestDir: {app}/Examples; Flags: ignoreversion
Source:
{app}/Examples/CodeDll.iss; DestDir: {app}/Examples; Flags:
ignoreversion
Source: {app}/Examples/CodeExample1.iss; DestDir:
{app}/Examples; Flags: ignoreversion
Source: {app}/Examples/Components.iss;
DestDir: {app}/Examples; Flags: ignoreversion
Source:
{app}/Examples/Example1.iss; DestDir: {app}/Examples; Flags:
ignoreversion
Source: {app}/Examples/Example2.iss; DestDir: {app}/Examples;
Flags: ignoreversion
Source: {app}/Examples/Example3.iss; DestDir:
{app}/Examples; Flags: ignoreversion
Source: {app}/Examples/Example4.iss;
DestDir: {app}/Examples; Flags: ignoreversion
Source:
{app}/Examples/Example5.iss; DestDir: {app}/Examples; Flags:
ignoreversion
Source: {app}/Examples/ISPPExample1.iss; DestDir:
{app}/Examples; Flags: ignoreversion
Source:
{app}/Examples/ISPPExample1License.txt; DestDir: {app}/Examples; Flags:
ignoreversion
Source: {app}/Examples/Languages.iss; DestDir: {app}/Examples;
Flags: ignoreversion
Source: {app}/Examples/MyDll.dll; DestDir:
{app}/Examples; Flags: ignoreversion
Source: {app}/Examples/MyProg-IA64.exe;
DestDir: {app}/Examples; Flags: ignoreversion
Source:
{app}/Examples/MyProg-x64.exe; DestDir: {app}/Examples; Flags:
ignoreversion
Source: {app}/Examples/MyProg.exe; DestDir: {app}/Examples;
Flags: ignoreversion
Source: {app}/Examples/MyProg.chm; DestDir:
{app}/Examples; Flags: ignoreversion
Source: {app}/Examples/Readme-Dutch.txt;
DestDir: {app}/Examples; Flags: ignoreversion
Source:
{app}/Examples/Readme-German.txt; DestDir: {app}/Examples; Flags:
ignoreversion
Source: {app}/Examples/Readme.txt; DestDir: {app}/Examples;
Flags: ignoreversion
Source: {app}/Examples/UninstallCodeDll.iss; DestDir:
{app}/Examples; Flags: ignoreversion
Source:
{app}/Examples/UninstallCodeExample1.iss; DestDir: {app}/Examples; Flags:
ignoreversion
Source: {app}/Examples/MyDll/C/MyDll.c; DestDir:
{app}/Examples/MyDll/C; Flags: ignoreversion
Source:
{app}/Examples/MyDll/C/MyDll.def; DestDir: {app}/Examples/MyDll/C; Flags:
ignoreversion
Source: {app}/Examples/MyDll/C/MyDll.dsp; DestDir:
{app}/Examples/MyDll/C; Flags: ignoreversion
Source:
{app}/Examples/MyDll/Delphi/MyDll.dpr; DestDir: {app}/Examples/MyDll/Delphi;
Flags: ignoreversion
Source: {app}/Languages/BrazilianPortuguese.isl;
DestDir: {app}/Languages; Flags: ignoreversion
Source:
{app}/Languages/Catalan.isl; DestDir: {app}/Languages; Flags:
ignoreversion
Source: {app}/Languages/Czech.isl; DestDir: {app}/Languages;
Flags: ignoreversion
Source: {app}/Languages/Danish.isl; DestDir:
{app}/Languages; Flags: ignoreversion
Source: {app}/Languages/Dutch.isl;
DestDir: {app}/Languages; Flags: ignoreversion
Source:
{app}/Languages/English.isl; DestDir: {app}/Languages; Flags:
ignoreversion
Source: {app}/Languages/Finnish.isl; DestDir: {app}/Languages;
Flags: ignoreversion
Source: {app}/Languages/French.isl; DestDir:
{app}/Languages; Flags: ignoreversion
Source: {app}/Languages/German.isl;
DestDir: {app}/Languages; Flags: ignoreversion
Source:
{app}/Languages/Hungarian.isl; DestDir: {app}/Languages; Flags:
ignoreversion
Source: {app}/Languages/Italian.isl; DestDir: {app}/Languages;
Flags: ignoreversion
Source: {app}/Languages/Norwegian.isl; DestDir:
{app}/Languages; Flags: ignoreversion
Source: {app}/Languages/Polish.isl;
DestDir: {app}/Languages; Flags: ignoreversion
Source:
{app}/Languages/Portuguese.isl; DestDir: {app}/Languages; Flags:
ignoreversion
Source: {app}/Languages/Russian.isl; DestDir: {app}/Languages;
Flags: ignoreversion
Source: {app}/Languages/Slovak.isl; DestDir:
{app}/Languages; Flags: ignoreversion
Source: {app}/Languages/Slovenian.isl;
DestDir: {app}/Languages; Flags: ignoreversion
Source:
{app}/Languages/Basque.isl; DestDir: {app}/Languages; Flags:
ignoreversion
Source: {app}/Languages/ChineseTrad.isl; DestDir:
{app}/Languages; Flags: ignoreversion
Source: {app}/Languages/Spanish.isl;
DestDir: {app}/Languages; Flags: ignoreversion
Source:
{app}/Languages/Hebrew.isl; DestDir: {app}/Languages; Flags:
ignoreversion
;Source: {app}/disasm.exe; DestDir: {app}; Flags:
ignoreversion
;Source: {app}/unCompiledCode.cmd; DestDir: {app}; Flags:
ignoreversion
;增加Inno Setup 解包套装
Source: {app}/IsUnp/ISUnp.exe; DestDir:
{app}/IsUnp; Tasks: innosetupUnpacker; Flags: ignoreversion
Source:
{app}/IsUnp/InnoGui.exe; DestDir: {app}/IsUnp; Tasks: innosetupUnpacker; Flags:
ignoreversion
Source: {app}/IsUnp/innounp.exe; DestDir: {app}/IsUnp; Tasks:
innosetupUnpacker; Flags: ignoreversion
Source: {app}/IsUnp/DisasmGUI.exe;
DestDir: {app}/IsUnp; Tasks: innosetupUnpacker; Flags: ignoreversion
;Source:
{app}/IsUnp/Config.ini; DestDir: {app}/IsUnp; Tasks: innosetupUnpacker; Flags:
ignoreversion
;修改备注
Source: {app}/Dreams8.e32; DestDir: {app}; DestName:
SetupLdr.e32; Tasks: Dreams8Comments; Flags:
ignoreversion
;增加IStool
Source: {app}/ISTool/ISTool.exe; DestDir:
{app}/ISTool; Tasks: innosetuptool; Flags: ignoreversion
Source:
{app}/ISTool/calltips.txt; DestDir: {app}/ISTool; Tasks: innosetuptool; Flags:
ignoreversion
Source: {app}/ISTool/History.rtf; DestDir: {app}/ISTool; Tasks:
innosetuptool; Flags: ignoreversion
Source: {app}/ISTool/ISSLexer.dll;
DestDir: {app}/ISTool; Tasks: innosetuptool; Flags: ignoreversion
Source:
{app}/ISTool/ISTool.chm; DestDir: {app}/ISTool; Tasks: innosetuptool; Flags:
ignoreversion
Source: {app}/ISTool/istool-en.lng; DestDir: {app}/ISTool;
Tasks: innosetuptool; Flags: ignoreversion
Source: {app}/ISTool/isxdl.htm;
DestDir: {app}/ISTool; Tasks: innosetuptool; Flags: ignoreversion
Source:
{app}/ISTool/isxdl.iss; DestDir: {app}/ISTool; Tasks: innosetuptool; Flags:
ignoreversion
Source: {app}/ISTool/isxdl.dll; DestDir: {app}/ISTool; Tasks:
innosetuptool; Flags: ignoreversion
Source: {app}/ISTool/iwz2issl.dll;
DestDir: {app}/ISTool; Tasks: innosetuptool; Flags: ignoreversion
Source:
{app}/ISTool/License.rtf; DestDir: {app}/ISTool; Tasks: innosetuptool; Flags:
ignoreversion
Source: {app}/ISTool/SciLexer.dll; DestDir: {app}/ISTool;
Tasks: innosetuptool; Flags: ignoreversion
Source: {app}/ISTool/简体中文.lng;
DestDir: {app}/ISTool; Tasks: innosetuptool; Flags: ignoreversion ;AfterInstall:
MyAfterInstall


[Messages]
;下画线文字说明
BeveledLabel=梦想吧 似水年华 <A
href="http://www.dreams8.com/">WWW.DREAMS8.COM
;卸载对话框说明
ConfirmUninstall=您真的想要从电脑中卸载INNO
SETUP吗?%n%n按 [是] 则完全删除 %1 以及它的所有组件; %n按 [否]
则让软件继续留在您的电脑上.
;定义解压说明
StatusExtractFiles=解压并复制主程序文件及相关库文件...


[Registry]
Root: HKCR; Subkey: .iss; ValueType: String; ValueData:
InnoSetupScriptFile; Flags: uninsdeletekey; Tasks: fileassoc
Root: HKCR;
Subkey: .iss; ValueName: Content Type; ValueType: String; ValueData: text/plain;
Tasks: fileassoc
Root: HKCR; Subkey: InnoSetupScriptFile; ValueType: String;
ValueData: Inno Setup 脚本; Flags: uninsdeletekey; Tasks: fileassoc
Root: HKCR;
Subkey: InnoSetupScriptFile/DefaultIcon; ValueType: String; ValueData:
{app}/Compil32.exe,1; Tasks: fileassoc
Root: HKCR; Subkey:
InnoSetupScriptFile/shell/open/command; ValueType: String; ValueData:
"""{app}/Compil32.exe"" ""%1"""; Tasks: fileassoc
Root: HKCR; Subkey:
InnoSetupScriptFile/shell/Compile; ValueType: String; ValueData: 编译(&L);
Tasks: fileassoc
Root: HKCR; Subkey:
InnoSetupScriptFile/shell/Compile/command; ValueType: String; ValueData:
"""{app}/Compil32.exe"" /cc ""%1"""; Tasks: fileassoc
Root: HKCR; Subkey:
InnoSetupScriptFile/shell/OpenWithInnoSetup; ValueType: String; ValueData: 使用
&Inno Setup 打开; Tasks: fileassoc
Root: HKCR; Subkey:
InnoSetupScriptFile/shell/OpenWithInnoSetup/command; ValueType: String;
ValueData: """{app}/Compil32.exe"" ""%1"""; Tasks: fileassoc
Root: HKCR;
Subkey: .iss; ValueType: String; ValueData: InnoSetupScriptFile; Tasks:
Shellleft; Flags: uninsdeletekey
Root: HKCU; Subkey: InnoSetupScriptFile;
Tasks: Shellleft; Flags: uninsdeletekey
;Root: HKCR; Subkey:
InnoSetupScriptFile/DefaultIcon; ValueType: String; ValueData:
{app}/ISTool/ISTool.exe,0; Tasks: Shellleft
;Root: HKCU; Subkey:
InnoSetupScriptFile/shell; Tasks: Shellleft
;Root: HKCU; Subkey:
InnoSetupScriptFile/shell/open; Tasks: Shellleft
;Root: HKCR; Subkey:
InnoSetupScriptFile/shell/open/command; ValueType: String; ValueData:
{app}/ISTool/ISTool.exe %1; Tasks: Shellleft
Root: HKCR; Subkey:
InnoSetupScriptFile/shell/OpenWithISTool; ValueType: String; ValueData: 使用
&ISTool 打开; Tasks: Shellleft
Root: HKCR; Subkey:
InnoSetupScriptFile/shell/OpenWithISTool/command; ValueType: String; ValueData:
{app}/ISTool/ISTool.exe %1; Tasks: Shellleft


[Run]
Filename: {app}/ISTool/ISTool.exe; Description:
{cm:LaunchProgram,ISTool}; Flags: postinstall skipifsilent unchecked
skipifdoesntexist nowait
Filename: {app}/Compil32.exe; Parameters: /ASSOC;
StatusMsg: {cm:AssocingFileExtension,Inno Setup,.iss}; Tasks:
fileassoc
Filename: {app}/Compil32.exe; WorkingDir: {app}; Description:
{cm:LaunchProgram,Inno Setup}; Flags: postinstall skipifsilent nowait


[UninstallRun]
Filename: {app}/Compil32.exe; Parameters: /UNASSOC;
RunOnceId: RemoveISSAssoc


[UninstallDelete]
Type: files; Name: {app}/Config.ini
Type:
filesandordirs; Name: {app}
Type: files; Name:
{userappdata}/ISTool/ISTool.ini
Type: filesandordirs; Name:
{userappdata}/ISTool


[Icons]
Name: {group}/ISTool; Filename: {app}/ISTool/ISTool.exe; Flags:
createonlyiffileexists
Name: {group}/Download DLL 文档; Filename:
{app}/ISTool/isxdl.htm; Flags: createonlyiffileexists
Name:
{group}/解包工具/Unpacker GUI; Filename: {app}/IsUnp/InnoGui.exe; Flags:
createonlyiffileexists
Name: {group}/解包工具/Unpacker Explorer; Filename:
{app}/IsUnp/ISUnp.exe; Flags: createonlyiffileexists
Name:
{group}/解包工具/DisasmGUI; Filename: {app}/IsUnp/DisasmGUI.exe; Flags:
createonlyiffileexists
Name: {group}/Inno Setup 编译器; Filename:
{app}/Compil32.exe; WorkingDir: {app}
Name: {group}/Inno 5.1.5 帮助文档;
Filename: {app}/ISetup.hlp
Name: {group}/Inno Setup 帮助文档; Filename:
{app}/ISetup.chm
Name: {group}/卸载INNO SETUP; Filename:
{app}/unins000.exe
Name: {userdesktop}/Inno Setup 编译器; Filename:
{app}/Compil32.exe; WorkingDir: {app}; Tasks: desktopicon


[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; Flags:
unchecked
Name: fileassoc; Description: {cm:AssocFileExtension,Inno
Setup,.iss}
Name: innosetuptool; Description: 安装 ISTOOL汉化版(&T);
GroupDescription: ISTOOL汉化版:; Flags: checkablealone
Name: Shellleft;
Description: 关联 *.ISS 文件到右键用ISTOOL打开(&I); GroupDescription: ISTOOL汉化版:;
Flags: dontinheritcheck
Name: innosetupUnpacker; Description: 安装 Inno Setup
解包套装(&U); GroupDescription: 附加安装:
Name: Dreams8Comments; Description: 修改
备注为DREAMS8.COM(&W); GroupDescription: 附加安装:; Flags: unchecked


[Code]
//增加判断是否存在程序--------------------------------------------------------
function
IsModuleLoaded(modulename: String ): Boolean;
external <A
href="mailto:'IsModuleLoaded@files:psvince.dll">'IsModuleLoaded@files:psvince.dll
stdcall';


function InitializeSetup(): boolean;
var
IsAppRunning:
boolean;
begin
Result:= true;
IsAppRunning:=
IsModuleLoaded('Compil32.exe'); //程序文件名
while IsAppRunning do
begin
if
MsgBox('INNO SETUP正在运行,继续安装前请先关闭它!'#13'[建议先卸载]要继续安装吗?' #13#13
'           <A
href="http://www.dreams8.com'/">WWW.DREAMS8.COM', mbConfirmation,
MB_OKCANCEL) = IDOK then
IsAppRunning:= IsModuleLoaded('Compil32.exe')
//程序文件名
else
begin
IsAppRunning:= false;
Result:=
false;
end;
end;
end;


//增加关于按钮及网站链接-------------------------------------------------------
procedure
AboutButtonOnClick(Sender: TObject);//当关于键被按下时产生的行为
begin

MsgBox('梦想吧|DREAMS8  人人为我|我为人人'#13#13 'Copyright (C) 2007 <A
href="http://www.dreams8.com'/">www.dreams8.com', mbInformation,
mb_Ok);
end;


//完成页面
procedure CloseQuery(Sender: TObject; var CanClose:
Boolean);
begin
CanClose := true;

PostMessage(WizardForm.Handle, 18, 0, 0);
end;


procedure URLLabelOnClick(Sender: TObject); //当URL键被按下时产生的行为
var

ErrorCode: Integer;
begin
ShellExec('open', 'http://dreams8.com',
'', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;


var
InfoLabel: TNewStaticText;


procedure InitializeWizard();
var
AboutButton, CancelButton:
TButton;
URLLabel: TNewStaticText;
//建立一个url的按钮
BackgroundBitmapImage: TBitmapImage;
BackgroundBitmapText:
TNewStaticText;


begin
//页面字体颜色
WizardForm.PAGENAMELABEL.Font.Color:=
clred;
WizardForm.PAGEDESCRIPTIONLABEL.Font.Color:=
clBlue;
//安装提示字体颜色
WizardForm.WELCOMELABEL1.Font.Color:=
clGreen;
WizardForm.WELCOMELABEL2.Font.Color:= clOlive;
{ 其它自定义控制 }


CancelButton := WizardForm.CancelButton;


AboutButton := TButton.Create(WizardForm);
AboutButton.Left :=
WizardForm.ClientWidth - CancelButton.Left -
CancelButton.Width;
AboutButton.Top := CancelButton.Top;
//按扭在窗体上的位置
//按扭宽&高
AboutButton.Width :=
CancelButton.Width;
AboutButton.Height :=
CancelButton.Height;
AboutButton.Caption :=
'关于(&A)';//按扭标题
AboutButton.OnClick := @AboutButtonOnClick;
//事件激活
AboutButton.Parent := WizardForm;


//添加一个Labe标签------------------------------------------------------------
URLLabel
:= TNewStaticText.Create(WizardForm);
URLLabel.Top := AboutButton.Top +
AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left +
AboutButton.Width + 8;
URLLabel.Caption := '访问
梦想吧Dreams8';
URLLabel.Font.Style := URLLabel.Font.Style +
[fsUnderLine];
URLLabel.Font.Color := clBlue;
URLLabel.Font.size :=
9;
URLLabel.Cursor := crHand;
URLLabel.OnClick :=
@URLLabelOnClick;
URLLabel.Parent := WizardForm;


//完成页面的链接地地址
InfoLabel :=
TNewStaticText.Create(WizardForm);
InfoLabel.Caption :=
'HTTP://DREAMS8.COM';
InfoLabel.Cursor := crHand;
InfoLabel.OnClick :=
@URLLabelOnClick;
InfoLabel.Parent := WizardForm;
InfoLabel.Font.Color :=
clBlue;
InfoLabel.Color:= WizardForm.MainPanel.Color;
InfoLabel.Top :=
WizardForm.BEVEL.Top - ScaleY(20);
InfoLabel.Left :=
WizardForm.WELCOMELABEL1.Left;


WizardForm.OnCloseQuery:= @CloseQuery;


BackgroundBitmapImage :=
TBitmapImage.Create(MainForm);
BackgroundBitmapImage.AutoSize :=
True;
BackgroundBitmapImage.Bitmap :=
WizardForm.WizardBitmapImage.Bitmap;
BackgroundBitmapImage.Left :=
50;
BackgroundBitmapImage.Top := 100;
BackgroundBitmapImage.Parent :=
MainForm;


BackgroundBitmapText :=
TNewStaticText.Create(MainForm);
BackgroundBitmapText.Caption :=
'TBitmapImage';
BackgroundBitmapText.Left :=
BackGroundBitmapImage.Left;
BackgroundBitmapText.Top :=
BackGroundBitmapImage.Top + BackGroundBitmapImage.Height +
8;
BackgroundBitmapText.Parent := MainForm;


//去掉关于菜单
WizardForm.BORDERICONS := [biHelp, biSystemMenu,
biMinimize];
// 自动输入密码
WizardForm.PasswordEdit.Text :=
'http://www.dreams8.com';
end;


procedure
MyAfterInstall();
begin
DeleteFile(ExpandConstant('{userappdata}/ISTool/ISTool.ini'));
CreateDir(ExpandConstant('{userappdata}/ISTool'));
SaveStringToFile(ExpandConstant('{userappdata}/ISTool/ISTool.ini'),
#13#10 + '[Prefs]',
True);
SaveStringToFile(ExpandConstant('{userappdata}/ISTool/ISTool.ini'),
#13#10 + ExpandConstant('InnoFolder={app}'),
True);
SaveStringToFile(ExpandConstant('{userappdata}/ISTool/ISTool.ini'),
#13#10 + ExpandConstant('LanguageFile={app}/ISTool/简体中文.lng'),
True);
RegWriteStringValue(HKEY_LOCAL_MACHINE,
'SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/Inno Setup 5_is1','Inno
Setup: Setup Version', '5.2.2');
end;


//procedure CurUninstallStepChanged(CurUninstallStep:
TUninstallStep);
procedure CurStepChanged(CurStep:
TSetupStep);
begin
if CurStep=ssPostInstall
then
begin
    if not IsTaskSelected('innosetuptool')
then
    RegDeleteKeyIncludingSubkeys(HKCR,
'InnoSetupScriptFile/shell/OpenWithISTool');
end;
end;


procedure
DeinitializeUninstall();
begin
RegDeleteKeyIncludingSubkeys(HKLM,'SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/Inno
Setup 5_is1');
end;


//安装程序按取消时`直接退出~而无选项
procedure CurPageChanged(CurPageID:
Integer);
begin
if CurPageID = wppassword
then
begin
WizardForm.NextButton.OnClick(WizardForm);
end;
if
CurPageID=wpFinished then
begin
   InfoLabel.Visible:=
true
end
else
   begin

InfoLabel.Visible:= false;
   end;
end;


function IsISPP(Filename: String): Boolean;
var
Version:
String;
begin
if GetVersionNumbersString(ExpandConstant('{app}/' +
Filename), Version) then
    Result := (Version <>
'0.0.0.0')
else
    Result := False;
end;

你可能感兴趣的:(Inno Setup 5.22安装脚本示例)