Skip to content

Commit 50f7c70

Browse files
committed
[GEN][ZH] Unify the Autorun tool with changes from JFS (#739)
1 parent bfa9891 commit 50f7c70

File tree

12 files changed

+185
-82
lines changed

12 files changed

+185
-82
lines changed

Generals/Code/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ target_include_directories(gi_libraries_source_wwvegas_ww3d2 INTERFACE "Librarie
1919
target_include_directories(gi_libraries_source_wwvegas_wwmath INTERFACE "Libraries/Source/WWVegas/WWMath")
2020
target_include_directories(gi_libraries_source_wwvegas_wwsaveload INTERFACE "Libraries/Source/WWVegas/WWSaveLoad")
2121
target_include_directories(gi_main INTERFACE "Main")
22+
23+
target_compile_definitions(gi_always INTERFACE
24+
RTS_GENERALS=1
25+
)
2226
target_link_libraries(gi_always INTERFACE
2327
core_utility
2428
gi_libraries_include

Generals/Code/Tools/Autorun/AUTORUN.RC

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,29 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
138138
// Bitmap
139139
//
140140

141+
#if defined(APSTUDIO_INVOKED) || defined(_ENGLISH)
142+
#if defined(APSTUDIO_INVOKED)
143+
BACKGROUND$(_ENGLISH) BITMAP DISCARDABLE "Autorun_BG.bmp"
144+
#else
141145
BACKGROUND BITMAP DISCARDABLE "Autorun_BG.bmp"
146+
#endif
147+
#endif
142148
BUTTON_SEL BITMAP DISCARDABLE "ARButton_Sel.bmp"
143149
BUTTON_REG BITMAP DISCARDABLE "ARButton_Reg.bmp"
150+
#if defined(APSTUDIO_INVOKED) || defined(_FRENCH)
151+
#if defined(APSTUDIO_INVOKED)
152+
BACKGROUND$(_FRENCH) BITMAP DISCARDABLE "AutoRun_Frn.bmp"
153+
#else
154+
BACKGROUND BITMAP DISCARDABLE "AutoRun_Frn.bmp"
155+
#endif
156+
#endif
157+
#if defined(APSTUDIO_INVOKED) || defined(_GERMAN)
158+
#if defined(APSTUDIO_INVOKED)
159+
BACKGROUND$(_GERMAN) BITMAP DISCARDABLE "AutoRun_Ger.bmp"
160+
#else
161+
BACKGROUND BITMAP DISCARDABLE "AutoRun_Ger.bmp"
162+
#endif
163+
#endif
144164

145165
#ifdef APSTUDIO_INVOKED
146166
/////////////////////////////////////////////////////////////////////////////
@@ -150,13 +170,12 @@ BUTTON_REG BITMAP DISCARDABLE "ARButton_Reg.bmp"
150170

151171
1 TEXTINCLUDE DISCARDABLE
152172
BEGIN
153-
"..\\resource.h\0"
173+
"resource.h\0"
154174
END
155175

156176
2 TEXTINCLUDE DISCARDABLE
157177
BEGIN
158-
"#include ""afxres.h""\r\n"
159-
"\0"
178+
"#include ""afxres.h""\0"
160179
END
161180

162181
3 TEXTINCLUDE DISCARDABLE

Generals/Code/Tools/Autorun/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ macro(setup_autorun appname)
5454
target_sources(${appname} PRIVATE ${AUTORUN_SRC})
5555

5656
target_link_libraries(${appname} PRIVATE
57-
gi_always
5857
core_config
58+
gi_always
5959
winmm
6060
)
6161

Generals/Code/Tools/Autorun/ViewHTML.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,28 @@ bool ViewHTML(const char* url, bool wait, const CallbackHook& callback)
7979

8080
//--------------------------------------------------------------------------
8181
// Create unique temporary HTML filename
82+
// JFS: Fixed so that it would go to the temp folder which was crashing
83+
// on limited users.
8284
//--------------------------------------------------------------------------
8385
char tempPath[MAX_PATH];
84-
GetWindowsDirectory(tempPath, MAX_PATH);
85-
8686
char filename1[MAX_PATH];
8787
char filename2[MAX_PATH];
88+
89+
// Expand the TMP environment variable.
90+
{
91+
DWORD dwResult;
92+
dwResult = ExpandEnvironmentStrings( "%TEMP%", tempPath, MAX_PATH);
93+
if(dwResult == 0)
94+
return false;
95+
}
96+
8897
GetTempFileName(tempPath, "WS", 0, filename1);
8998

9099
strcpy( filename2, filename1 );
91100
char* extPtr = strrchr(filename2, '.');
92101
strcpy(extPtr, ".html");
93102

103+
94104
// DebugPrint(filename);
95105
Msg( __LINE__, TEXT(__FILE__), TEXT("filename = %s"), filename2 );
96106

0 commit comments

Comments
 (0)