inno setup 6 打包C# winform 程序安装包

注:
checkablealone  "选中"意思
unchecked "非选中"意思

图标选择:IconFilename: "{app}\Images\SysIcon.ico"

#define MyAppName "LuoCore"
#define MyAppVersion "1.5"
#define MyAppPublisher "LuoCore"
#define MyAppURL "https://www.luocore.com/"
#define MyAppExeName "LuoCore.exe"
#define MyAppAssocName MyAppName + ""
#define MyAppAssocExt ".exe"
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt

[Setup]
; 注意:AppId 是应用程序唯一标识值。不要在安装程序中对其他应用程序使用相同的 AppId 值。
;(要生成新的 GUID,请在 IDE 内单击“工具 | 生成 GUID)”。
AppId={{D58B98CC-LuoCore-123}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
ChangesAssociations=yes
DisableProgramGroupPage=yes
; 取消下列注释行,以在非管理员安装模式下运行(仅为当前用户安装。)
;PrivilegesRequired=lowest
OutputDir=盘符:\路径\Inno Setup 6\编辑宏
OutputBaseFilename=LuoCore安装包名称_setup
SetupIconFile=盘符:\路径\Inno Setup 6\编辑宏\LuoCore\Images\SysIcon.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
Name: "chinesetraditional"; MessagesFile: "compiler:Languages\ChineseTraditional.isl"

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

[Files]
Source: "盘符:\路径\Inno Setup 6\编辑宏\LuoCore\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "盘符:\路径\Inno Setup 6\编辑宏\LuoCore\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; 注意:  在任何共享系统文件上不要使用 “Flags: ignoreversion”

[Registry]
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: ".myp"; ValueData: ""

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\Images\SysIcon.ico"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon;IconFilename: "{app}\Images\SysIcon.ico"

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

  2024-10-10-完善了控制面板卸载程序图标不显示问题

; 脚本由 Inno Setup 脚本向导生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!

; 定义应用程序名称
#define MyAppName "LuoCore"
; 定义应用程序版本
#define MyAppVersion "2"
; 定义应用程序发布公司
#define MyAppPublisher "LuoCore科技有限公司"
; 定义应用程序官方网站
#define MyAppURL "https://www.LuoCore.com/"
; 定义应用程序的主执行文件名
#define MyAppExeName "LuoCore.exe"
; 定义文件关联名称
#define MyAppAssocName MyAppName + " 文件"
; 定义文件扩展名
#define MyAppAssocExt ".exe"
; 定义文件关联的注册键
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt

[Setup]
; 应用程序唯一识别 ID
AppId={{写自己得Code}
; 应用程序名称
AppName={#MyAppName}
; 应用程序版本
AppVersion={#MyAppVersion}
; 应用程序发布公司
AppPublisher={#MyAppPublisher}
; 应用程序发布网页
AppPublisherURL={#MyAppURL}
; 应用程序支持网页
AppSupportURL={#MyAppURL}
; 应用程序更新网页
AppUpdatesURL={#MyAppURL}
; 默认安装目录
DefaultDirName={autopf}\{#MyAppName}
; 更改文件关联
ChangesAssociations=yes
; 禁用程序组页面
DisableProgramGroupPage=yes
; 输出目录
OutputDir=B:\LuoCore\安装包
; 输出安装包基文件名
OutputBaseFilename=LuoCore_Setup
; 安装程序图标
SetupIconFile=B:\LuoCore\Images\SysIcon.ico
; 压缩方式
Compression=lzma
; 是否采用整体压缩
SolidCompression=yes
; 向导样式
WizardStyle=modern

; 设置控制面板中程序图标
UninstallDisplayIcon={app}\Images\SysIcon.ico
; 设置控制面板中程序的名称
Uninstallable=yes
UninstallDisplayName={#MyAppName}

[Languages]
; 使用简体中文语言
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"

[Tasks]
; 创建桌面图标任务
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone

[Files]
; 主执行文件配置
Source: "B:\LuoCore\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
; 其他文件配置
Source: "B:\LuoCore\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; 图标文件配置
Source: "B:\LuoCore\Images\SysIcon.ico"; DestDir: "{app}\Images"; Flags: ignoreversion

[Registry]
; 文件类型关联的注册表设置
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
; 设置程序图标在控制面板中的显示
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Images\SysIcon.ico"
; 文件打开命令
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
; 支持的文件类型
Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: ".myp"; ValueData: ""

[Icons]
; 开始菜单图标配置
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\Images\SysIcon.ico"
; 桌面图标配置
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\Images\SysIcon.ico"
; 公共桌面图标配置
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{app}\Images\SysIcon.ico"

[Run]
; 安装后自动运行主程序
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

 

posted @ 2023-08-19 13:10  LuoCore  阅读(211)  评论(0编辑  收藏  举报