一 安装包制作
- 准备好可执行的应用程序
- 下载info setup软件 (下载地址:http://www.jrsoftware.org/isdl.php#stable)
- 编辑脚本,生成exe https://www.cnblogs.com/linuxAndMcu/p/10974927.html
二 走过的坑
- 生成 安装程序.exe,双击开始安装 ,但是安装完成后点击界面生成的可执行程序会提示少库, 通过可执行程序找到路径下的原来的可执行程序,双击可以正常运行,查看是因为在安装exe时,会默认在路径下面创建一个exe,(直接把原来的exe拷贝过来),所以在执行应用程序的时候,可执行程序会按照原来的路径依赖关系去查找库,查找不到就会提示找不到库,找不到资源文件。
需要设置运行程序的路径:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Test"
#define MyAppVersion "2020.0115"
#define MyAppPublisher "mycompany.Inc."
#define MyAppURL "http://www.mycompany.com/"
#define MyAppExeName "Tesy.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={
{5DEDA9C7-6A3D-4898-AB9B-5B5BEEC15922}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
; The [Icons] "quicklaunchicon" entry uses {userappdata} but its [Tasks] entry has a proper IsAdminInstallMode Check.
UsedUserAreasWarning=no
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=D:\output
OutputBaseFilename=Test
SetupIconFile=D:\work\Test\Test\Test.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: