编程语言
首页 > 编程语言> > c – 为我的游戏创建安装程序(.exe)

c – 为我的游戏创建安装程序(.exe)

作者:互联网

我在Glut C中建立了一个保龄球游戏并拥有我的.exe文件.

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

我想做的是: –

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

我怎样才能做到这一点.我猜Iexpress无法做到这一点.

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

解决方法:

我会研究NSIS(Nullsoft Scriptable Install System)

首先看一下Simple Tutorials: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:\Windows\System32

# 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和其他人是正确的.你真的不应该将非系统.dll放在一个包含所有重要系统.dll的目录中.世界不会因此而结束,但这不是最好的做法.也许您可以与NSIS合作开发一个能够满足您需求的安装程序.然后我建议您在更合适的位置安装OpenGL / GLUT库/标头.

标签:c,windows,windows-installer,exe
来源: https://codeday.me/bug/20190725/1533905.html