add launchdf binary so steam has an exe to launch
parent
980f673454
commit
f974ac043f
@ -0,0 +1,7 @@
|
||||
project(package_windows)
|
||||
|
||||
if(WIN32)
|
||||
add_executable(launchdf WIN32 launchdf.c)
|
||||
install(TARGETS launchdf
|
||||
DESTINATION ${DFHACK_DATA_DESTINATION})
|
||||
endif()
|
@ -0,0 +1,42 @@
|
||||
#include <windows.h>
|
||||
|
||||
int WINAPI wWinMain(HINSTANCE hi, HINSTANCE hpi, PWSTR cmd, int ns)
|
||||
{
|
||||
STARTUPINFOA si;
|
||||
PROCESS_INFORMATION pi;
|
||||
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
ZeroMemory(&pi, sizeof(pi));
|
||||
|
||||
CHAR dfdir[1024];
|
||||
|
||||
if (GetFullPathNameA("..", 1024, dfdir, NULL) == 0)
|
||||
{
|
||||
MessageBoxA(NULL, "could not get current directory", NULL, 0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (SetCurrentDirectoryA(dfdir) == 0)
|
||||
{
|
||||
MessageBoxA(NULL, "could not change to DF directory", NULL, 0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (CreateProcessA("Dwarf Fortress.exe",
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
&si,
|
||||
&pi) == 0)
|
||||
{
|
||||
MessageBoxA(NULL, "could not launch 'Dwarf Fortress.exe'", NULL, 0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
Loading…
Reference in New Issue