为我的游戏创建一个安装程序(.exe)

Create an installer for my game(.exe)

本文关键字:一个 程序 exe 安装 我的 游戏 创建      更新时间:2023-10-16

我用Glut C++构建了一个保龄球游戏,并有我的.exe文件。

现在我想为这个游戏创建一个安装程序。

我想做的是:-

当我的安装程序运行时,glut32.dll被粘贴在system32文件夹中,我的游戏的.exe文件在桌面上或任何地方。

我该怎么做Iexpress可能无法做到这一点。

注意:-glut32.dll必须在system32文件夹中才能运行此游戏。

错误。glut32.dll不必system32中。它只需要位于.exe文件旁边。(或系统PATH中的某个位置)。

您应该能够创建一个安装程序,使用InstallShield或IDE中的类似向导来解压缩您的文件。

我会研究NSIS(Nullsoft Scriptable Install System)

从简单教程开始:http://nsis.sourceforge.net/Simple_tutorials

它们将向您展示如何简单地将一些文件复制到用户的计算机上。类似这样的东西:

# define the name of the installer
outfile "game_installer.exe"
# define the directory to install to
installDir $DESKTOP
# default section
section install
# define the output path for this file
setOutPath C:WindowsSystem32
# define what to install and place it in the output path
File glut32.dll
# define the output path for this file
setOutPath $INSTDIR 
# define what to install and place it in the output path
File bowling_game.exe
sectionEnd

注意:Bartek Banachewicz和其他人是正确的。你真的不应该把非system.dls和你所有重要的system.dls放在一个目录里。世界不会因此而结束,但这不是最好的做法。也许你可以与NSIS合作开发一个可以随心所欲的安装程序。然后,我建议您将OpenGL/GLUT库/标头安装在更合适的位置。

相关文章: