使用inno setup制作安装包

 近日Installshield在查盗版情况,公司开发的一套产品正好也使用了Installshield制作安装包。没办法只能换其他安装包制作工作,谁叫单

位穷呢,不舍得花钱。只能苦了腌们做事的人。网上查了好多这样的工具,最后选定Inno。

Inno的网址是http://www.jrsoftware.org/isinfo.php

Inno Setup is a free installer for Windows programs. First introduced in 1997, Inno Setup today rivals and even surpasses

many commercial installers in feature set and stability.

下了个windows的安装包,能用就行,懒得下源代码编译。

制作安装包,无非是写写脚本,怎么写脚本呢?看帮助手册和看提供的example。

等脚本有点熟悉了,那就开始写了。

有第三方得工具库,可以方便得在图形化工具得提示下完成脚本得编写,当然无论是用第三方图形工具还是直接写脚本,每个人
各有所爱。


例子如下


; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
AppName=MYAPPName ;名字
AppVerName=APP1.0 ;版本
DefaultDirName={pf}/MYApp ;安装目录,pf表示 Program File
DefaultGroupName=我自己的程序  ; 组名,在开始菜单中的显示
DisableProgramGroupPage=yes
LicenseFile=C:/dfddfd/license.txt ;许可文件的路径,就是我们平时点 接受还是不接受看到的内容。
OutputDir=D:/WorkDir/OutputSetupFile  ;最后生成的安装包的存放路径
OutputBaseFilename=Setup  ; 安装包的名字
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags:

unchecked

[Files]
Source: "D:/ZP/WorkDir/Mydata/App.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:/ZP/WorkDir/Mydata/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Registry]
Root: HKCU; Subkey: "SOFTWARE/MYAPP/Client/1.000"; Flags: uninsdeletekey; ValueType: string; ValueName: "A"; ValueData:

"{app}/aaaaaaaaaaa.dat"     ;字符型
Root: HKCU; Subkey: "SOFTWARE/MYAPP/Client/1.000"; Flags: uninsdeletekey; ValueType: binary; ValueName: "B"; ValueData:      

                      ;二进制型
Root: HKCU; Subkey: "SOFTWARE/MYAPP/Client/1.000"; Flags: uninsdeletekey; ValueType: dword; ValueName: "C"; ValueData: 0     

                      ;DWORD型

[Icons]
Name: "{group}/我的程序"; Filename: "{app}/App.exe"; WorkingDir: "{app}"
Name: "{group}/{cm:UninstallProgram,软件}"; Filename: "{uninstallexe}"
Name: "{commondesktop}/快捷方式"; Filename: "{app}/App.exe"; Tasks: desktopicon; WorkingDir: "{app}"

 

 

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页