Inno Steup 6 下载,安装,将 .exe 文件打包成安装程序(详细教程)

下载

  1. 点击链接进入官网:https://jrsoftware.org/isdl.php

    image-20211118143202793

  2. 选则版本后,点击下载(以6.2.0版本为例)

    image-20211118143137278

  3. 等待下载完成

    image-20211118143240372

  4. 下载完成

    image-20211118143310027

安装

  1. 双击文件运行

    image-20211118143310027

  2. 选中语言,默认 English,点击【OK】

    image-20211118143615377

  3. 勾选【I accept the agreement】,点击【Next】

    image-20211118143655868

  4. 设置安装位置,点击【Next】

    image-20211118143740047

  5. 默认即可,点击【Next】

    image-20211118143915038

  6. 默认即可,点击【Next】

    image-20211118143931501

  7. 默认即可,点击【Next】

    image-20211118143954584

  8. 默认即可,点击【Install】

    image-20211118144011640

  9. 等待安装完成

    image-20211118144025342

  10. 安装完成

    image-20211118144040463

安装程序添加中文语言包

注:此教程改变的不是 Inno Setup 的语言,改变的是生成的安装包进行安装时可选择的语言。

  1. 访问官网语言包:https://jrsoftware.org/files/istrans/

    image-20211118144928179

  2. 下拉到非官方翻译,选择 Chinese (Simplified),在 Download 列鼠标右键,另存为

    image-20211118144840233

    注:此处需要翻墙

  3. 选择保存位置

    image-20211118145206249

  4. 下载完成

    image-20211118145238278

  5. 将下载的【ChineseSimplified.isl】文件移动到 【Inno Setup6】目录下的【Languages】文件夹下

    image-20211118145337999

打包 .exe 文件为安装包

此处的 .exe 文件是一个普通的 Java 项目,用 IDEA 先将项目打包成 Jar 包,再用 exe4j 将 Jar 包转为 .exe 文件。

这里为了让安装包可以在没有安装 JDK 的电脑上运行,也会把 Jre 打包到安装包中。

如果你也需要或者你想复现,可以跟着博客来做:

  1. 为你提供如何使用 IDEA 将普通的 Java 项目打包成 Jar 包:IDEA 将普通 Java 项目打包成 Jar 包并运行
  2. 为你提供将 Jar 包转为 .exe 可执行文件的方法:使用 exe4j 将 jar 包生成 .exe 文件(敲详细)

打包步骤:

  1. 双击运行已安装的 【Inno Setup】

    image-20211118150524639

  2. 选中【Create a new script file using the Script Wizard】,点击【OK】

    image-20211118150801616

  3. 点击【Next】

    image-20211118150840782

  4. 设置应用名称、应用版本、公司、网址;点击【Next】

    image-20211118150954181

  5. 设置安装目录,点击【Next】

    image-20211118151035615

  6. 添加主程序文件、依赖文件(附程序文件),点击【Next】

    image-20211118151606458

  7. 点击【Next】

    image-20211118151711247

  8. 应用程序图标设置,点击【Next】

    image-20211118152143839

  9. 许可证设置(可选),点击【Next】

    image-20211118152239302

  10. 默认即可,点击【Next】

    image-20211118152429994

  11. 勾选安装程序支持的语言包,点击【Next】

    image-20211118152453303

  12. 设置安装包名称,图标,点击【Next】

    image-20211118160057188

  13. 点击【Next】

    image-20211118152756019

  14. 点击【Finish】

    image-20211118152806397

  15. 点击【是(Y)】

    image-20211118152825318

  16. 点击【是(Y)】

    image-20211118154612444

  17. 保存脚本文件

    image-20211118152902090

  18. 等待压缩完成

    image-20211118153030972

  19. 压缩完成

    image-20211118153129880

  20. 在准备的 .exe 目录下会自动的生成一个 Output 文件,进入该目录就可以看到生成的安装包了

    image-20211118155913401

运行安装包测试

  1. 双击运行

    image-20211118155111198

  2. 选择语言

    image-20211118155134935

  3. 设置安装位置

    image-20211118155204578

  4. 创建桌面快捷方式

    image-20211118155238195

  5. image-20211118155251525

  6. 安装

    image-20211118155307357

  7. 安装完成

    image-20211118155322135

  8. 桌面快捷方式

    image-20211118155419935

  9. 双击运行,成功

    image-20211118155522494

Inno Setup 是一个开源的安装程序制作工具,可以用来制作 Windows 平台上的安装程序。以下是使用 Inno Setup 打包 PyTorch 应用程序的步骤: 1.下载安装 Inno Setup。 2.创建一个新的 Inno Setup 脚本文件,例如 `pytorch.iss`。 3.在脚本文件中添加以下代码,用于定义安装程序的基本信息和文件路径: ``` ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "PyTorch" #define MyAppVersion "1.0" #define MyAppPublisher "My Company" #define MyAppURL "http://www.example.com/" #define MyAppExeName "pytorch.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={{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} AppName={#MyAppName} AppVersion={#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName={pf}\{#MyAppName} DefaultGroupName={#MyAppName} OutputDir=. OutputBaseFilename=pytorch-setup Compression=lzma SolidCompression=yes [Files] Source: "pytorch.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "torch.dll"; DestDir: "{app}"; Flags: ignoreversion Source: "cudart64_101.dll"; DestDir: "{app}"; Flags: ignoreversion [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{#MyAppName}"; Flags: nowait postinstall skipifsilent ``` 4.将 PyTorch 应用程序和相关的 DLL 文件复制到与脚本文件相同的目录中。 5.在命令行中运行以下命令,使用 Inno Setup 打包 PyTorch 应用程序: ``` ISCC pytorch.iss ``` 6.打包功后,会在当前目录下生一个可执行的安装程序文件 `pytorch-setup.exe`,可以使用它来在 Windows 上安装 PyTorch 应用程序。 注意:在脚本文件中的 `AppId` 需要使用 Inno Setup 的 `Tools` 菜单中的 `Generate GUID` 命令生一个新的 GUID。此外,还需要根据实际情况修改脚本文件中的其他信息,例如应用程序名称、版本号、发布者等。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

@赵士杰

如果对你有用,可以进行打赏,感

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值