1 ; Openc2e Game Finder Script
2 ; by Eric Goodwin (ElasticMuffin)
4 ; Last Update: 10/24/06 (add C2)
7 Name "openc2e Game Finder Script"
8 OutFile "gamefinder.exe"
34 !macro IfKeyExists ROOT MAIN_KEY KEY
38 !define Index
'Line${__LINE__}'
44 EnumRegKey $R0 ${ROOT} "${MAIN_KEY}" "$R1"
45 StrCmp $R0 "" "${Index}-False"
47 StrCmp $R0 "${KEY}" "${Index}-True" "${Index}-Loop"
55 ;Return 0 if not found
68 ReadRegStr $dir HKLM "Software\openc2e" ""
70 DetailPrint "Checking for Creatures games installed on your computer..."
74 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\CyberLife Technology" "Creatures 3"
77 DetailPrint "Found Creatures 3 (original)."
78 ReadRegStr $plainc3 HKEY_LOCAL_MACHINE "Software\CyberLife Technology\Creatures 3" "Main Directory"
79 StrCpy $R1 "$plainc3" 1 -1
80 StrCpy $plainc3exist "1"
81 StrCmp "$R1" "\" trim1
84 StrCpy $plainc3 "$plainc3" -1
86 CreateShortCut "$SMPROGRAMS\openc2e\Games\Creatures 3.lnk" "$dir\openc2e.exe" '-d "$plainc3" --autokill'
88 DetailPrint "Could not find Creatures 3 (original)."
89 Delete "$SMPROGRAMS\openc2e\Games\Creatures 3.lnk"
93 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\CyberLife Technology" "Docking Station"
96 DetailPrint "Found Docking Station (original)."
97 ReadRegStr $plainds HKEY_LOCAL_MACHINE "Software\CyberLife Technology\Docking Station" "Main Directory"
98 StrCpy $R1 "$plainds" 1 -1
99 StrCmp "$R1" "\" trim2
102 StrCpy $plainds "$plainds" -1
104 CreateShortCut "$SMPROGRAMS\openc2e\Games\Docking Station.lnk" "$dir\openc2e.exe" '--gamename "Docking Station" -d "$plainds" --autokill'
105 ${If} $plainc3exist ==
"1"
106 DetailPrint "Creating Docked shortcut for C3/DS (original)."
107 CreateShortCut "$SMPROGRAMS\openc2e\Games\C3 + DS (Docked).lnk" "$dir\openc2e.exe" '--gamename "Docking Station" -d "$plainc3" -d "$plainds" --autokill'
109 Delete "$SMPROGRAMS\openc2e\Games\C3 + DS (Docked).lnk"
112 DetailPrint "Could not find Docking Station (original)."
113 Delete "$SMPROGRAMS\openc2e\Docking Station.lnk"
117 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\CyberLife Technology" "Edynn"
120 DetailPrint "Found Edynn."
121 ReadRegStr $edynn HKEY_LOCAL_MACHINE "Software\CyberLife Technology\Edynn" "Main Directory"
122 StrCpy $R1 "$edynn" 1 -1
123 StrCmp "$R1" "\" trim3
126 StrCpy $edynn "$edynn" -1
128 CreateShortCut "$SMPROGRAMS\openc2e\Games\Edynn.lnk" "$dir\openc2e.exe" '--gamename "Edynn" -d "$edynn" --autokill'
130 DetailPrint "Could not find Edynn."
131 Delete "$SMPROGRAMS\openc2e\Games\Edynn.lnk"
135 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\Gameware Development" "Creatures 3"
138 DetailPrint "Found Creatures 3 (Exodus)."
139 ReadRegStr $exodc3 HKEY_LOCAL_MACHINE "Software\Gameware Development\Creatures 3" "Main Directory"
140 StrCpy $R1 "$exodc3" 1 -1
141 StrCpy $exodc3exist "1"
142 StrCmp "$R1" "\" trim4
145 StrCpy $exodc3 "$exodc3" -1
147 CreateShortCut "$SMPROGRAMS\openc2e\Games\Creatures 3 (Exodus).lnk" "$dir\openc2e.exe" '-d "$exodc3" --autokill'
149 DetailPrint "Could not find Creatures 3 (Exodus)."
150 Delete "$SMPROGRAMS\openc2e\Games\Creatures 3 (Exodus).lnk"
154 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\Gameware Development" "Docking Station"
157 DetailPrint "Found Docking Station (Exodus)."
158 ReadRegStr $exodds HKEY_LOCAL_MACHINE "Software\Gameware Development\Docking Station" "Main Directory"
159 StrCpy $R1 "$exodds" 1 -1
160 StrCmp "$R1" "\" trim5
163 StrCpy $exodds "$exodds" -1
165 CreateShortCut "$SMPROGRAMS\openc2e\Games\Docking Station (Exodus).lnk" "$dir\openc2e.exe" '--gamename "Docking Station" -d "$exodds" --autokill'
166 ${If} $exodc3exist ==
"1"
167 DetailPrint "Creating Docked shortcut for C3/DS (Exodus)."
168 CreateShortCut "$SMPROGRAMS\openc2e\Games\C3 + DS Exodus (Docked).lnk" "$dir\openc2e.exe" '--gamename "Docking Station" -d "$exodc3" -d "$exodds" --autokill'
170 Delete "$SMPROGRAMS\openc2e\Games\C3 + DS Exodus (Docked).lnk"
173 DetailPrint "Could not find Docking Station (Exodus)."
174 Delete "$SMPROGRAMS\openc2e\Games\Docking Station (Exodus).lnk"
177 ;Creatures Adventures
178 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\CyberLife Technology" "Creatures Adventures"
181 DetailPrint "Found Creatures Adventures."
182 ReadRegStr $ca HKEY_LOCAL_MACHINE "Software\CyberLife Technology\Creatures Adventures" "Main Directory"
183 StrCpy $R1 "$ca" 1 -1
184 StrCmp "$R1" "\" trim6
189 CreateShortCut "$SMPROGRAMS\openc2e\Games\Creatures Adventures.lnk" "$dir\openc2e.exe" '--gamename "Creatures Adventures" -d "$ca" -g cv'
191 DetailPrint "Could not find Creatures Adventures."
192 Delete "$SMPROGRAMS\openc2e\Games\Creatures Adventures.lnk"
195 ;Creatures Playground
196 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\CyberLife Technology" "Creatures Playground"
199 DetailPrint "Found Creatures Playground."
200 ReadRegStr $cp HKEY_LOCAL_MACHINE "Software\CyberLife Technology\Creatures Playground" "Main Directory"
201 StrCpy $R1 "$cp" 1 -1
202 StrCmp "$R1" "\" trim7
207 CreateShortCut "$SMPROGRAMS\openc2e\Games\Creatures Playground.lnk" "$dir\openc2e.exe" '--gamename "Creatures Playground" -d "$cp" -g cv'
209 DetailPrint "Could not find Creatures Playground."
210 Delete "$SMPROGRAMS\openc2e\Games\Creatures Playground.lnk"
214 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\Gameware Development" "Creatures Village"
217 DetailPrint "Found Creatures Village."
218 ReadRegStr $cv HKEY_LOCAL_MACHINE "Software\Gameware Development\Creatures Village" "Main Directory"
219 StrCpy $R1 "$cv" 1 -1
220 StrCmp "$R1" "\" trim8
225 CreateShortCut "$SMPROGRAMS\openc2e\Games\Creatures Village.lnk" "$dir\openc2e.exe" '-d "$cv" -g cv'
227 DetailPrint "Could not find Creatures Village."
228 Delete "$SMPROGRAMS\openc2e\Games\Creatures Village.lnk"
232 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\Cyberlife Technology" "Creatures 2"
235 DetailPrint "Found Creatures 2 (original)."
236 ReadRegStr $plainc2 HKEY_LOCAL_MACHINE "Software\Cyberlife Technology\Creatures 2\1.0" "Main Directory"
237 StrCpy $R1 "$plainc2" 1 -1
238 StrCmp "$R1" "\" trim9
241 StrCpy $plainc2 "$plainc2" -1
243 CreateShortCut "$SMPROGRAMS\openc2e\Games\Creatures 2.lnk" "$dir\openc2e.exe" '-d "$plainc2" -g c2 --autokill'
245 DetailPrint "Could not find Creatures 2 (original)."
246 Delete "$SMPROGRAMS\openc2e\Games\Creatures 2.lnk"
250 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\Millennium Interactive" "Creatures"
253 DetailPrint "Found Creatures 1 (original)."
254 ReadRegStr $plainc1 HKEY_LOCAL_MACHINE "Software\Millennium Interactive\Creatures\1.0" "Main Directory"
255 StrCpy $R1 "$plainc1" 1 -1
256 StrCmp "$R1" "\" trim10
259 StrCpy $plainc1 "$plainc1" -1
261 CreateShortCut "$SMPROGRAMS\openc2e\Games\Creatures 1.lnk" "$dir\openc2e.exe" '-d "$plainc1" -g c1 --autokill'
263 DetailPrint "Could not find Creatures 1 (original)."
264 Delete "$SMPROGRAMS\openc2e\Games\Creatures 1.lnk"
268 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\Gameware Development" "Creatures 2"
271 DetailPrint "Found Creatures 2 (The Albian Years)."
272 ReadRegStr $tayc2 HKEY_LOCAL_MACHINE "Software\Gameware Development\Creatures 2\1.0" "Main Directory"
273 StrCpy $R1 "$tayc2" 1 -1
274 StrCmp "$R1" "\" trim11
277 StrCpy $tayc2 "$tayc2" -1
279 CreateShortCut "$SMPROGRAMS\openc2e\Games\Creatures 2 (TAY).lnk" "$dir\openc2e.exe" '-d "$tayc2" -g c2 --autokill'
281 DetailPrint "Could not find Creatures 2 (The Albian Years)."
282 Delete "$SMPROGRAMS\openc2e\Games\Creatures 2 (TAY).lnk"
286 !insertmacro IfKeyExists
"HKEY_LOCAL_MACHINE" "Software\Gameware Development" "Creatures 1"
289 DetailPrint "Found Creatures 1 (The Albian Years)."
290 ReadRegStr $tayc1 HKEY_LOCAL_MACHINE "Software\Gameware Development\Creatures 1\1.0" "Main Directory"
291 StrCpy $R1 "$tayc1" 1 -1
292 StrCmp "$R1" "\" trim12
295 StrCpy $tayc1 "$tayc1" -1
297 CreateShortCut "$SMPROGRAMS\openc2e\Games\Creatures 1 (TAY).lnk" "$dir\openc2e.exe" '-d "$tayc1" -g c1 --autokill'
299 DetailPrint "Could not find Creatures 1 (The Albian Years)."
300 Delete "$SMPROGRAMS\openc2e\Games\Creatures 1 (TAY).lnk"
304 BrandingText "openc2e Gamefinder"