Inno Setup:一个来自开源社区优秀的轻量级打包工具

时间:2021-12-11 18:41:00

用他打包以前用IntallShield 9 打包的 GPS服务器程序,感觉相当不错:)在VMWare中测试通过;与IntallShield这个重量级的工具相比较,几个地方值得一试:
可以修改安装界面几个关键的图标,和Installshield不同,不需要从底层修改Intallshield的资源文件,只需要在脚本中明确指定替换的内容和目标即可
安装时可以让用户指定是否创建桌面图标或者导航栏的快捷方式(Quick Launch);

设置安装文件setup.exe显示的图标
SetupIconFile=I:/Harvie_Works/GPS_Dev/devlop_sourecode/DExchanger/res/DExchanger.ico
;设置安装窗体显示的图片
WizardImageFile=I:/Harvie_Works/GPS_Dev/devlop_sourecode/DExchanger/res/setupll.bmp
;设置安装界面显示的个性化图标
WizardSmallImageFile=I:/Harvie_Works/GPS_Dev/devlop_sourecode/DExchanger/res/setupsa.bmp

安装界面效果图:

Inno Setup:一个来自开源社区优秀的轻量级打包工具

图一

Inno Setup:一个来自开源社区优秀的轻量级打包工具

图二

注意界面中窗体标题栏图标和图二中有GPS字样的图标,这几个地方的改动,如果在InstallShield中修改的话,相当费事,而在inno中则几句简单的脚本即可搞定.

同样的一个程序,用IntallShield打包之后,几个文件共记4.01M大小

用Inno Setup打包之后,1838Kb,不到2M

试用InstallShied制作卸载快捷键,在9.0中还是要做很多工作,但是Inno中,只要在创建工程的时候进行简单的选择即可完成:

Inno Setup:一个来自开源社区优秀的轻量级打包工具

在Inno中利用脚本语言,包含MFC库代码如下:
; begin VC system files
; (Note: Scroll to the right to see the full lines!)
Source: "I:/Setup_support/MFC/asycfilt.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile
Source: "I:/Setup_support/MFC/atla.dll";     DestName: "atl.dll"; DestDir: "{sys}"; MinVersion: 4, 0; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "I:/Setup_support/MFC/atlu.dll";     DestName: "atl.dll"; DestDir: "{sys}"; MinVersion: 0, 4; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "I:/Setup_support/MFC/comcat.dll";   DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "I:/Setup_support/MFC/mfc42.dll";    DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "I:/Setup_support/MFC/mfc42u.dll";   DestDir: "{sys}"; MinVersion: 0, 4; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "I:/Setup_support/MFC/msvcp60.dll";  DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile
Source: "I:/Setup_support/MFC/msvcirt.dll";  DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile
Source: "I:/Setup_support/MFC/msvcrt.dll";   DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile
Source: "I:/Setup_support/MFC/oleaut32.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "I:/Setup_support/MFC/olepro32.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "I:/Setup_support/MFC/stdole2.tlb";  DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regtypelib
; end VC system files

不过这里好像是个Bug:)后来仔细看了一下,并非BUG
*** 正在开始编译. [0:10:19]
......中间是编译过程
*** 完成.[0:10:46,用时 00:27.000]
应该是27秒完成编译过程,而不是00:27.000
哦,sorry,看错了,在这里才弄明白,原来他也是表示27秒,27.000而不是27:000

这是软件连接地址http://www.jrsoftware.org/,目前版本是Inno Setup 5.1.4