[Tool]Inno Setup创建软件安装程序。

这篇博客将介绍如何使用Inno Setup创建一个软件安装程序。

Inno Setup官网:http://www.jrsoftware.org/isinfo.php。 可以下载到最新的Inno Setup,目前最新的版本5.5.9. Inno Setup的安装程序支持非常广泛,从Windows 2000到Windows 10都支持。目前的版本中没有官方出品的中文语言包,不过国内有开发者提供了中文的语言包,请参考:http://www.cnblogs.com/shiningrise/p/5662249.html

将下载好的语言包,放置在Inno Setup安装目录Languages文件夹下即可。

下面是一个Inno Setup制作的安装包脚本,

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

#define MyAppName "Smart NST"
#define MyAppVersion "1.0"
#define MyAppPublisher "NST.inc"
#define MyAppURL "http://www.nst.com"
#define MyAppExeName "Aries.Presentation.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{26AEFF50-EC0D-4EBE-A2E4-12184EAF1DED}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
InfoBeforeFile=C:\Users\V-CHENFY\Desktop\init.rtf
OutputDir=C:\Users\V-CHENFY\Desktop\
OutputBaseFilename=NST
SetupIconFile=D:\Development\NST\Libs\NST.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "chinese"; MessagesFile: "compiler:Languages\Chinese.isl"

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

[Files]
Source: "C:\Users\V-CHENFY\Desktop\Base\Aries.Presentation.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\V-CHENFY\Desktop\Base\Aries.Common.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\V-CHENFY\Desktop\Base\Aries.Framework.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\V-CHENFY\Desktop\Base\Aries.Presentation.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\V-CHENFY\Desktop\Base\Aries.Presentation.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\V-CHENFY\Desktop\Base\MahApps.Metro.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\V-CHENFY\Desktop\Base\System.Windows.Interactivity.dll"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't 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
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait shellexec postinstall skipifsilent

注意最后加粗的shellexec,当需要执行的程序是需要管理员权限时,记得一定要加上这个命令。

转载于:https://www.cnblogs.com/yang-fei/p/6211933.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值