青青园中葵,朝露待日晞。 阳春布德泽,万物生光辉。 常恐秋节至,焜黄华叶衰。 百川东到海,何时复西归? 少壮不努力,老大徒伤悲!

windwos innosetup 打包

1、下载 innosetup 安装包

下载地址:https://jrsoftware.org/

2、安装 innosetup

双击下载的 exe 执行安装

3、打开 innosetup,创建打包

:如果已存在相关打包配置文件,可以直接选择打开













4、附上一个打包.net 6 的样例配置

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

#define MyAppName "SP.RAS.Sync"
#define MyAppVersion "1.1.0.10"
#define MyAppPublisher "****有限公司, Inc."
#define MyAppURL "http://www.syspetro.com/"
#define MyAppExeName "SP.MQS.Sync.Web.Entry.exe"
#define MyAppDecription "****快评智能服务"

[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={{52262FFE-7078-4286-B552-4615D59E81CC}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=D:\github
OutputBaseFilename=SP.RAS.Sync_{#MyAppVersion}
Compression=lzma
SolidCompression=yes
WizardStyle=modern
SetupIconFile=favicon.ico
VersionInfoVersion={#MyAppVersion}
VersionInfoDescription={#MyAppDecription}

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

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

[Files]
Source:"D:\Program Files\Inno Setup 6\data\aspnetcore-runtime-6.0.31-win-x64.exe";DestDir:"{tmp}";Flags:ignoreversion
Source:"D:\Program Files\Inno Setup 6\data\dotnet-runtime-6.0.31-win-x64.exe";DestDir:"{tmp}";Flags:ignoreversion
Source:"D:\Program Files\Inno Setup 6\data\syspetro.ico";DestDir:"{app}";Flags:ignoreversion
Source: "E:\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\syspetro.ico"
Name: "{autodesktop}\{#MyAppDecription}"; Filename: "{app}\{#MyAppDecription}.url"; IconFilename: "{app}\favicon.ico"; WorkingDir: "{app}";Tasks: desktopicon
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

[Run]
Filename: "{tmp}\aspnetcore-runtime-6.0.31-win-x64.exe"; Parameters: "/install /quiet"; Flags: runhidden
Filename: "{tmp}\dotnet-runtime-6.0.31-win-x64.exe"; Parameters: "/install /quiet"; Flags: runhidden
Filename: "{sys}\sc.exe"; Parameters: "stop SP.RAS.Sync" ; Flags: runhidden
Filename: "{sys}\sc.exe"; Parameters: "delete SP.RAS.Sync" ; Flags: runhidden
Filename: "{sys}\sc.exe"; Parameters: "create SP.RAS.Sync start=auto binPath=""{app}\SP.MQS.Sync.Web.Entry.exe""" ; Flags: runhidden
Filename: "{sys}\sc.exe"; Parameters: "start SP.RAS.Sync" ; Flags: runhidden

[UninstallRun]
Filename: "{sys}\sc.exe"; Parameters: "stop SP.RAS.Sync" ; Flags: runhidden
Filename: "{sys}\sc.exe"; Parameters: "delete SP.RAS.Sync" ; Flags: runhidden
posted @ 2024-12-24 11:25  yhzou  阅读(167)  评论(0)    收藏  举报