7

我有两个文件,一个 EXE 一个 DLL

exe是vb.net应用程序的构建,我也需要那里的DLL

我想要的是一个将这些文件放在一起的自提取器,然后在运行时它将提取它们并立即运行 EXE

是否有一个非常简单易用的开箱即用软件可以做到这一点?商业与否,无所谓

4

2 回答 2

10

您可以使用NSIS(免费和开源)。它非常灵活,但它也可以用于如此简单的任务(在这种情况下它对我很有帮助)。假设您的文件名为yourapp.exeand yourlib.dll,您可以使用此脚本:

# this will be the created executable archive
OutFile "archive.exe"
# define the directory to install to, the installer's directory in this case 
InstallDir $EXEDIR

# don't create a window for the unarchiver
# You could get fancy and do all kinds of configuration 
#   in the non-silent install; this example is the simplest it can be.
SilentInstall silent

# the executable part
Section

# define the output path for the following files
SetOutPath $INSTDIR
# define what to install and place it in the output path...
# ...your app...
File yourapp.exe
# ...and the library.
File yourlib.dll

# run your application
ExecShell yourapp.exe

# done
SectionEnd

安装 NSIS,将此脚本创建为archive.nsi,右键单击它并选择“使用 NSIS 编译”。该文件archive.exe将被创建。

然后,在目标系统上,用户需要做的就是启动archive.exe;该脚本将解压缩并运行您的程序。

(如果你想变得花哨,你可以查看与 NSIS 一起安装的教程,或查看此页面。)

于 2010-08-18T10:59:28.463 回答
1

你可以试试WinZip

于 2010-08-18T02:13:19.377 回答