tomis13lack Posted November 27, 2017 Share Posted November 27, 2017 (edited) Those who make a standalone game might want an installer for it. It makes the game seem more professional. I have created a small NSIS script for those who want to use it to accomplish this. You will need to change stuff. I put the vital things you need to change on lines with 6 #'s. It doesn't look that good but NSI is really simple. Fixing it up should be easy. The #'s are comments. # comments 1 line but i used 6 around the text as an attention getter. semicolons as well as /*'s are also used for commenting on this. OutFile "GameInstaller.exe" !define pathToGame "C:\Users\**USERNAME HERE**\Desktop\**Gamename**\" ######Replace as you see fit###### InstallDir "C:\Program Files (x86)\NameofGame" ######Replace as you see fit###### Section SetOutPath $INSTDIR File /r ${pathToGame}\* WriteUninstaller $INSTDIR\uninstaller.exe SectionEnd Section Desktop MessageBox MB_YESNO "Create a Desktop Shortcut?" /SD IDYES IDNO end CreateShortcut "$desktop\myapp.lnk" "$instdir\gamename.exe" ######Replace gamename.exe with ur game's exe file###### end: SectionEnd Section -Prerequisites ######Any prerequisites go in here. I used OpenAL as an example###### SetOutPath $INSTDIR\OpenAL32 MessageBox MB_YESNO "Install OpenAL32?" /SD IDYES IDNO end ###Asks if they want to install openal in a message box File ${pathToGame}\dependencies\openalinst.exe ###i put the openal installer in a dependencies folder ExecWait ${pathToGame}\dependencies\openalinst.exe ### actaully installs openal end: SectionEnd Section "Uninstall" Delete $INSTDIR\uninstaller.exe Delete $INSTDIR\gamename ######Replace as you see fit###### SectionEnd You need NSIS for this. Here is a link: http://nsis.sourceforge.net/Download/ How to use it: Step 1. Paste the script in notepad Step 2. Save the script as install.nsi (or whatever-u-want.nsi) Step 3. open with NSIS and compile. If you have installed NSIS you should be able to compile by right clicking the nsi file and clicking "Compile with NSIS" Step 4. Enjoy the installer has everything in it. It will work on any system. You do not need anything but the installer to install. Edited November 28, 2017 by tomis13lack 1 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted November 27, 2017 Share Posted November 27, 2017 Don't forget the VS 2015 redistributable. For silent installation, here are the parameters (from INNO Setup): Filename: "{app}\_CommonRedist\OpenAL\2.0.7.0\oalinst.exe"; Parameters: "/s" Filename: "{app}\_CommonRedist\vcredist\2015\vc_redist.x86.exe"; Parameters: "/q" 1 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
GSFC_1 Posted November 28, 2017 Share Posted November 28, 2017 This is great to know, I will have to save this link for my later purposes. Well done. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.