VC Redistributables and installations

Discussion in 'Game Development (Technical)' started by zoombapup, Nov 10, 2010.

  1. zoombapup

    Moderator Original Member

    Joined:
    Nov 25, 2004
    Messages:
    2,890
    Likes Received:
    0
    Hey guys.

    I was wondering. How do you all deal with installing things like VC redistributables and physx system software? Just build them into your installer?

    What do you do for test builds? Build a proper installer?

    Most games on steam have an install process that has a bunch of redundant stages, plus I want to ship some test builds out to a few artists. So I wondered if there was any way to make it easier.

    Do you write a build script to install the various bits? Or is there a tool that does them automatically?

    My builds are getting a tad large :) will have to figure out a way to touch files so I know which ones are actually needed.
     
  2. Pogacha

    Original Member

    Joined:
    Jan 21, 2005
    Messages:
    605
    Likes Received:
    0
  3. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    +1 for nsis.

    You write the install script like you were making a batch file for copying the files from one folder to another, and from that it parses stuff and just does it.

    There're a lot of installer maker programs ranging between free and expensive, but none of them is as easy to use as nsis which is one of the free ones.

    In fact, I'm giving it another +1 right here.

    =====================>8================

    Here is the install script for that defender project of mine.

    Code:
    	
    WriteRegStr HKLM "Software\Rubicon\MegaDefender" "" $INSTDIR
      
    	WriteUninstaller "$INSTDIR\Uninstall.exe"
    
    
    	; Run the DX installer
    	ExecWait "dxsetup.exe /silent"
    
    	; Create shortcuts
    	SetOutPath 	"$INSTDIR"
    	CreateDirectory	"$SMPROGRAMS\Mega Defender"
    	CreateShortCut	"$SMPROGRAMS\Mega Defender\Uninstall.lnk" "$INSTDIR\uninstall.exe"
    	CreateShortCut	"$SMPROGRAMS\Mega Defender\Play Mega Defender.lnk" "$INSTDIR\Defender.exe"
    	CreateShortCut	"$DESKTOP\Mega Defender.lnk" "$INSTDIR\Defender.exe"
    
    
    SectionEnd
    
    ;--------------------------------
    ;Uninstaller Section
    ;--------------------------------
    
    Section "Uninstall"
    
    	; Remove installed files/folders
    	Delete		"$INSTDIR\Uninstall.exe"
    	Delete		"$INSTDIR\Defender.exe"
    	Delete		"$INSTDIR\DataPC.zip"
    	Delete		"$INSTDIR\Raz0rlog.html"
    	
    	Delete		"$INSTDIR\Redist\APR2007_xinput_x86.cab"
    	Delete		"$INSTDIR\Redist\DSETUP.dll"
    	Delete		"$INSTDIR\Redist\dsetup32.dll"
    	Delete		"$INSTDIR\Redist\dxdllreg_x86.cab"
    	Delete		"$INSTDIR\Redist\dxnt.cab"
    	Delete		"$INSTDIR\Redist\DXSETUP.exe"
    	Delete		"$INSTDIR\Redist\dxupdate.cab"
    	Delete		"$INSTDIR\Redist\Aug2009_d3dx9_42_x86.cab"
    	Delete		"$INSTDIR\Redist\Aug2009_XAudio_x86.cab"
    
    	RMDir		"$INSTDIR\Redist"
    	RMDir		"$INSTDIR"
    	
    	; Remove shortcuts
    	Delete		"$DESKTOP\Mega Defender.lnk"
    	Delete		"$SMPROGRAMS\Mega Defender\*.*"
    	RMDir		"$SMPROGRAMS\Mega Defender"
    
    
    	DeleteRegKey HKLM "Software\Rubicon\MegaDefender"
    
    SectionEnd
    
    EDIT: Just noticed that judicial use of "*" wildcards could've made that script far smaller still, but I'll leave it in the crap for now.
     
  4. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    Additional. For the MSVC stuff we just compile against the non DLL versions of the CRT and it gets built into the exe.
     
  5. jpoag

    jpoag New Member

    Joined:
    Mar 15, 2008
    Messages:
    806
    Likes Received:
    0
    Ditto
    5
    5;4
     
  6. Vino

    Vino New Member

    Joined:
    May 16, 2010
    Messages:
    345
    Likes Received:
    0
    You need to watch out for third party libraries though. I got burned because I used DevIL and DevIL was built on Visual Studio 8.0 DLL CRT's, so even though I used VS 10 to build the project the application demanded 8.0 runtimes, which fucked up some people. I had to recompile DevIL with the static runtimes.

    The solution of linking runtimes staticly is frowned on by Microsoft but fuck them, they should have thought of that when they designed a system that requires users to install something they don't care about to install something they do care about.
     
  7. Adrian Lopez

    Original Member

    Joined:
    Sep 7, 2004
    Messages:
    489
    Likes Received:
    0
    Yup. One of the programs I'm developing uses a bunch of Open Source libraries, most of which I've downloaded in the form of precompiled packages (compiling Open Source libraries under Windows can often be quite a nightmare). Alas, relying on libraries compiled by others can create dependency problems such that your application ends up depending on several versions of the VC libraries -- something that is best avoided.

    Dependency Walker is a great way to figure out which DLLs your software depends on. You can then configure Visual Studio to ignore particular default libraries and thus avoid redundant dependencies, though I wonder if there's any risks in doing so instead of compiling everything against the same default libraries.

    Also, you should watch out when linking statically against LGPL libraries since doing so means you must also distribute all the OBJ files needed to link your game into an EXE.
     
  8. zoombapup

    Moderator Original Member

    Joined:
    Nov 25, 2004
    Messages:
    2,890
    Likes Received:
    0
    Yeah, I really don't want to have to mess around with DLL's at all if I can help it. Specifically not the microsoft runtimes though. The others I cant really get around (Phsyx, BASS etc).
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer