@@ -74,59 +74,37 @@ void Execute()
7474 // We try a new approach for Steam users.
7575 // Before, we used Steam to launch the game and tried to find the new process and inject it.
7676 // However, when the injection happens the game already executed a bit, so mods fail.
77- // Instead, we create a steam_appid.txt that allows us to execute SporeApp.exe directly
78-
79- if ( LauncherSettings . ForcedGalacticAdventuresSporeAppPath != null )
80- this . ExecutablePath = LauncherSettings . ForcedGalacticAdventuresSporeAppPath ;
81-
82- if ( LauncherSettings . ForcedSporebinEP1Path == null )
83- {
84- this . ProcessSporebinPath ( ) ;
85- }
86- else
87- {
88- SporebinPath = LauncherSettings . ForcedSporebinEP1Path ;
89- }
77+ // Instead, we create a steam_appid.txt that allows us to execute SporeApp.exe directly
78+ SporebinPath = PathDialogs . ProcessGalacticAdventures ( ) ;
9079
9180 // use the default path for now (we might have to use a different one for Origin)
92- if ( LauncherSettings . ForcedGalacticAdventuresSporeAppPath == null )
93- {
94- this . ExecutablePath = this . SporebinPath + "SporeApp.exe" ;
95-
96- this . ProcessExecutableType ( ) ;
97-
81+ this . ExecutablePath = this . SporebinPath + "SporeApp.exe" ;
82+ this . ProcessExecutableType ( ) ;
9883
99- if ( this . _executableType == GameVersionType . None )
100- {
101- // don't execute the game if the user closed the dialog
102- return ;
103- }
104- }
105- else
84+ if ( this . _executableType == GameVersionType . None )
10685 {
107- this . _executableType = LauncherSettings . GameVersion ;
86+ // don't execute the game if the user closed the dialog
87+ return ;
10888 }
10989
11090 // get the correct executable path
111- if ( LauncherSettings . ForcedGalacticAdventuresSporeAppPath == null )
91+ this . ExecutablePath = this . SporebinPath + GameVersion . ExecutableNames [ ( int ) this . _executableType ] ;
92+ if ( ! File . Exists ( this . ExecutablePath ) )
11293 {
113- this . ExecutablePath = this . SporebinPath + GameVersion . ExecutableNames [ ( int ) this . _executableType ] ;
114- if ( ! File . Exists ( this . ExecutablePath ) )
94+ // the file might only not exist in Origin (since Origin users will use a different executable compatible with ModAPI)
95+ if ( GameVersion . RequiresModAPIFix ( this . _executableType ) )
11596 {
116- // the file might only not exist in Origin (since Origin users will use a different executable compatible with ModAPI)
117- if ( GameVersion . RequiresModAPIFix ( this . _executableType ) )
118- {
119- if ( ! HandleOriginUsers ( ) )
120- {
121- return ;
122- }
123- }
124- else
97+ if ( ! HandleOriginUsers ( ) )
12598 {
126- throw new Exception ( CommonStrings . GalacticAdventuresNotFound ) ;
99+ return ;
127100 }
128101 }
102+ else
103+ {
104+ throw new Exception ( CommonStrings . GalacticAdventuresNotFound ) ;
105+ }
129106 }
107+
130108
131109 // we must also check if the steam_api.dll doesn't exist (it's required for Origin users)
132110 if ( GameVersion . RequiresModAPIFix ( this . _executableType ) && ! File . Exists ( this . SporebinPath + "steam_api.dll" ) )
@@ -292,14 +270,8 @@ void CreateSporeProcess()
292270 i ++ ;
293271 }
294272
295- string currentSporebinPath = string . Empty ;
296- if ( LauncherSettings . ForcedSporebinEP1Path != null )
297- currentSporebinPath = LauncherSettings . ForcedSporebinEP1Path ;
298- else
299- currentSporebinPath = this . SporebinPath ;
300-
301273 if ( ! NativeMethods . CreateProcess ( null , "\" " + this . ExecutablePath + "\" " + sb ,
302- IntPtr . Zero , IntPtr . Zero , false , NativeTypes . ProcessCreationFlags . CREATE_SUSPENDED , IntPtr . Zero , currentSporebinPath , ref this . StartupInfo , out this . ProcessInfo ) )
274+ IntPtr . Zero , IntPtr . Zero , false , NativeTypes . ProcessCreationFlags . CREATE_SUSPENDED , IntPtr . Zero , this . SporebinPath , ref this . StartupInfo , out this . ProcessInfo ) )
303275 {
304276 //throw new InjectException(Strings.ProcessNotStarted);
305277 int lastError = System . Runtime . InteropServices . Marshal . GetLastWin32Error ( ) ;
0 commit comments