Advertisement Jump to content
Sign in to follow this  

NSIS installer package and another question too!!

This topic is 3833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i doubt this is the right forums but here i go anyway. I finished my connect 4 ripoff and am in the process of creating an installer, well i found this one NSIS scriptable. I have the game installing fine and dandy and it adds it to the add/remove like any other program, however i'm trying to get the directx runtime to run silently when the user installs the program but its not happening. Here is the code, i thought this is how it would be done but apparantly not.
# define name of installer
outFile "FIAR Setup.exe"

# define installation directory
installDir "$PROGRAMFILES\MooseMan Studios"
installDirRegKey HKLM "Software\MooseManStudios\FourInARow" "Install_Dir"

RequestExecutionLevel admin

# start default section

	# set the installation directory as the destionation for the following actions
	setOutPath $INSTDIR

	# create the uninstaller
	writeUninstaller "$INSTDIR\uninstall.exe"

	# install dx runtime before installing game files
	file "Redist\"
	file "redist\"
	file "redist\dsetup32.dll"
	file "redist\"
	file "redist\"
	file "redist\"
	file "redist\"
	file "redist\"
	file "redist\"
	file "redist\"
	file "Redist\dxsetup.exe"
	file "Redist\dsetup.dll"
	ExecWait "$INSTDIR\dxsetup.exe/silent"

	# now delete the dx runtime files to clear up space in folder
	delete "$INSTDIR\"
	delete "$INSTDIR\"
	delete "$INSTDIR\dsetup32.dll"
	delete "$INSTDIR\"
	delete "$INSTDIR\"
	delete "$INSTDIR\"
	delete "$INSTDIR\"
	delete "$INSTDIR\"
	delete "$INSTDIR\"
	delete "$INSTDIR\"
	delete "$INSTDIR\dxsetup.exe"
	delete "$INSTDIR\dsetup.dll"

	# write the game files out to the install directory
	file "Four In A Row.exe"
	file background.tga
	file credits.jpg
	file intro.jpg
	file mainmenu.jpg

	# create a shortcut named "Four In A Row" on the desktop
	# point the new shortcut at the program executable
	createShortCut "$DESKTOP\Four In A Row.lnk" "$INSTDIR\Four In A Row.exe"

	# create a shortcut named "Four In A Row" in the menu folders
	CreateDirectory "$SMPROGRAMS\MooseMan Studios"
	createShortCut "$SMPROGRAMS\MooseMan Studios\Four In A Row.lnk" "$INSTDIR\Four In A Row.exe"
	createShortCut "$SMPROGRAMS\MooseMan Studios\Uninstall.lnk" "$INSTDIR\uninstall.exe"

	# write to system registry for add/remove functionality
	WriteRegStr HKLM SOFTWARE\MooseManStudios\FourInARow "Install_Dir" "$INSTDIR"

	# write uninstall strings
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FourInARow" "DisplayName" "Four In A Row (remove only)"
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FourInAROw" "UninstallString" '"$INSTDIR\uninstall.exe"'

# uninstaller section start
section "uninstall"
	# first, delete the uninstaller
	delete "$INSTDIR\uninstall.exe"

	# delete all the game files
	delete "$INSTDIR\Four In A Row.exe"
	delete "$INSTDIR\background.tga"
	delete "$INSTDIR\credits.jpg"
	delete "$INSTDIR\intro.jpg"
	delete "$INSTDIR\mainmenu.jpg"

	# delete from teh system registry
	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FourInARow"
	DeleteRegKey HKLM "SOFTWARE\MooseManStudios\FourInARow"

	# second, remove the link from the desktop and start menu
	delete "$DESKTOP\Four In A Row.lnk"
	delete "$SMPROGRAMS\MooseMan Studios\Four In A Row.lnk"
	delete "$SMPROGRAMS\MooseMan Studios\uninstall.lnk"
	RMDir "$SMPROGRAMS\Mooseman Studios"

	RMDir "$INSTDIR\MooseMan Studios"

# uninstaller section end

what am i doing wrong with the dx runtime install? And to my other question, i sent this to one of my former teachers from high school and he installed it on his computer but when he launches it he said he gets the error "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem." I know that it is the release build because all the other computers that i ran it on run fine, although all of them that i know of are vista, could it be something is missing from XP that he runs?

Share this post

Link to post
Share on other sites
I'm not familiar with NSIS, but perhaps this:

ExecWait "$INSTDIR\dxsetup.exe/silent"

should be this?

ExecWait "$INSTDIR\dxsetup.exe /silent"

As far as your error...that means that your executable depends on a DLL that isn't present on the PC. It doesn't look like you're including the Visual C++ Runtime with your should be including the redistributable that corresponds to the version of VC++ you're using. There's one for 2005, one for 2005 SP1, and one for 2008. Include that in your installer, and you can launch it the same way as the DX Redist.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!