创建一个自解压可执行文件,它将自身复制到 Windows 上的临时目录并自行启动
我想以自解压可执行形式分发安装程序。我想打包 32 位和 64 位 Windows 的版本。所以我有一个程序,它首先检查正在运行的 Windows 操作系统的版本,然后启动正确的程序。所以我有一个像这样的目录结构,
DetermineOS.exe
Win32\Win32Setup.exe
Win32\supporting win32 files
Win64\Win64Setup.exe
Win64\Supporting win64 files
我想将它们打包在一个名为 install.exe 之类的包中。当用户单击 install.exe 时,它会将此目录结构提取到临时位置并启动 DefineOS.exe,然后它将启动正确的 setup.exe
NSIS 是最简单的方法吗?这是一个复杂的 NSIS 脚本吗?谢谢。
I want to distribute a setup in a self extracting executable form. I want to pack versions for 32 bit and 64 windows. So I have a program which first checks the version of Windows OS running and then launches the correct program. SO I have a directory structure like this
DetermineOS.exe
Win32\Win32Setup.exe
Win32\supporting win32 files
Win64\Win64Setup.exe
Win64\Supporting win64 files
I want to pack them in a bundle called something like install.exe. When the user clicks install.exe it will extract this directory structure to the temp location and launch DetermineOS.exe which will then launch the correct setup.exe
Will NSIS be the easiest way to go? Would this be a compicated NSIS script? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在我看来,您唯一想要摆脱的就是解压到 %TEMP% 位置并运行某个 exe 文件。如果是这样的话,我不确定 NSIS 是最简单的方法。大多数档案支持自解压并在解压完成后运行命令。例如WinRAR和7z就有这样的模块。我的直觉是这个选项似乎比 NSIS 更容易。
不同的 bootstrappers 也支持这种情况。例如,Visual Studio 引导程序 或 dotNetInstaller。我最近在博客中介绍了 dotNetInstaller 的这个最简单的案例。
希望这有帮助。
It sounds to me that the only thing you want to get out of it is to extract to the %TEMP% location and run a certain exe file. If that's the case, I'm not sure NSIS is the easiest way to go. Most of the archives support self-extraction and running a command on extraction-complete. For instance, WinRAR and 7z have such modules. And my gut feeling is this option seems to be easier than NSIS.
Different bootstrappers also support this scenario. For instance, Visual Studio bootstrapper or dotNetInstaller. I've recently blogged about this simplest case with dotNetInstaller.
Hope this helps.
您可以将不同的映像(可执行文件)放入“根”映像中,并根据需要提取并运行适当的映像(许多 Sysinternals 工具可以执行此操作 - 例如“根”应用程序嵌入 32 位和 64 位驱动程序。
You could put the different images (executables) in the "root" image and extract and run the appropriate image as needed (many Sysinternals tools do this - e.g. the "root" application embedds the drivers for 32 and 64 bit).