创建一个自解压可执行文件,该文件将自身复制到Windows上的temp目录并启动 [英] Creating a selfextracting executable which will copy itself to temp directory on Windows and launch itself

查看:224
本文介绍了创建一个自解压可执行文件,该文件将自身复制到Windows上的temp目录并启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以自解压的可执行文件形式分发安装程序.我想打包32位和64位窗口的版本.因此,我有一个程序,该程序首先检查运行的Windows OS版本,然后启动正确的程序.所以我有这样的目录结构

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

我想将它们打包在一个名为install.exe之类的捆绑物中.当用户单击install.exe时,它将把此目录结构提取到临时位置,并启动确定OS.exe,然后将启动正确的setup.exe

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

NSIS是最简单的方法吗?这会是复杂的NSIS脚本吗?谢谢.

Will NSIS be the easiest way to go? Would this be a compicated NSIS script? Thanks.

推荐答案

在我看来,您要摆脱的唯一事情是提取到%TEMP%位置并运行某个exe文件.如果是这样,我不确定NSIS是最简单的方法.大多数档案支持自解压并在提取完成时运行命令.例如,WinRAR和7z具有此类模块.我的直觉是,这个选项似乎比NSIS容易.

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.

不同的引导程序也支持这种情况.例如, Visual Studio引导程序关于使用dotNetInstaller的最简单案例的博客 a>.

Different bootstrappers also support this scenario. For instance, Visual Studio bootstrapper or dotNetInstaller. I've recently blogged about this simplest case with dotNetInstaller.

希望这会有所帮助.

这篇关于创建一个自解压可执行文件,该文件将自身复制到Windows上的temp目录并启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆