Hard Light Productions Forums

Hosted Projects - Standalone => The Babylon Project => Topic started by: Tolwyn on December 20, 2005, 02:11:28 pm

Title: How do you add values to the registry?
Post by: Tolwyn on December 20, 2005, 02:11:28 pm
I was just in the process of building an install shield for the next saga beta and I run into a small problem, which I hope you will be able to help me with. Obviosly you have to run the launcher after you have installed the game. And here is the problem: you have to browse for the executable file first. And of course flags have to be activated manually. I have noticed that TBP for instance had managed to conjure up a registry key, that does the trick. Could somebody enlighten me how this works? :)
Title: Re: How do you add values to the registry?
Post by: Fury on December 20, 2005, 11:17:42 pm
TBP uses NSIS installer, the installer is capable of writing to registry as well. Here's the relevant section from the installer build file;
Quote
Section "Registry" SEC02
  WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "CmdLineOptions" "-ambient_factor 60 -spec -glow -jpgtga -nomotiondebris -2d_poof -nobeampierce -dualscanlines -ship_choice_3d -targetinfo -orbradar -3dwarp -tbpwarpeffects -snd_preload"
  WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "ModSelected" ""
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3DTextureOrigin" "00000000"
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3DFast" "00000000"
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "ComputerSpeed" "00000004"
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3DUseLargeTextures" "00000002"
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3D8_AAType" "00000000"
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3D8_Adapter" "00000000"
  WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "VideocardFs2open" "D3D8-(1024x768)x32 bit"
  WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "Soundcard" "DirectSound"
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "SpeechTechRoom" "00000000"
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "SpeechBriefings" "00000000"
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "SpeechIngame" "00000000"
  WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "SpeechVoice" "00000000"
SectionEnd
Title: Re: How do you add values to the registry?
Post by: Wanderer on December 21, 2005, 12:41:00 am
Please, make also an option not to modify registry values... I managed with older TBP version to make a mess out of the registry entries. Game worked just fine but launcher crashed every time i opened the registry tab.
Title: Re: How do you add values to the registry?
Post by: Tolwyn on December 21, 2005, 01:00:37 am
Quote
Section "Registry" SEC02
 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "CmdLineOptions" "-ambient_factor 60 -spec -glow -jpgtga -nomotiondebris -2d_poof -nobeampierce -dualscanlines -ship_choice_3d -targetinfo -orbradar -3dwarp -tbpwarpeffects -snd_preload"
 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "ModSelected" ""
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3DTextureOrigin" "00000000"
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3DFast" "00000000"
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "ComputerSpeed" "00000004"
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3DUseLargeTextures" "00000002"
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3D8_AAType" "00000000"
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "D3D8_Adapter" "00000000"
 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "VideocardFs2open" "D3D8-(1024x768)x32 bit"
 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "Soundcard" "DirectSound"
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "SpeechTechRoom" "00000000"
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "SpeechBriefings" "00000000"
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "SpeechIngame" "00000000"
 WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Volition\Freespace2" "SpeechVoice" "00000000"
SectionEnd

Thanks, I think this is exactly what I have been looking for :)
Title: Re: How do you add values to the registry?
Post by: Fury on December 21, 2005, 02:55:36 am
Please, make also an option not to modify registry values... I managed with older TBP version to make a mess out of the registry entries. Game worked just fine but launcher crashed every time i opened the registry tab.

From TBP FAQ:
Quote
Question: When I use the Launcher, "Registry" tab might generate an error.
Answer: This is normal when you have no Freespace 2 installed. It has no effect on The Babylon Project.
Never seen the launcher to crash when opening registry tab though, I guess its a bug in the launcher. There has been no problem reports on the issue either, so your case is probably an isolated case.
Title: Re: How do you add values to the registry?
Post by: Tolwyn on December 21, 2005, 03:48:41 am
Yes, it worked. Thanks guys :)

(ignore the typo, I have already fixed it (i.e. -spec instead of spec))

(http://web396.xps1.microserver.de/wcsaga/Tolwyn/pictures/registry.jpg)