Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update data/win/launch/launch.cpp

Changes the working directory to the location of the exe file
Fixes: https://github.com/appjs/appjs/issues/188
  • Loading branch information...
commit a548820ca43ca63c4ef4fe0f710618203ea484a9 1 parent b1b21ef
@josiasmontag josiasmontag authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 data/win/launch/launch.cpp
View
4 data/win/launch/launch.cpp
@@ -1,6 +1,7 @@
#include <windows.h>
#include <string>
#include <resource.h>
+#include <direct.h>
using namespace std;
@@ -217,6 +218,9 @@ wstring GetString(int id){
}
int WINAPI WinMain(HINSTANCE hinst, HINSTANCE, LPTSTR args, int nCmdShow){
+ wstring workingdirectory= ExecutablePath().substr(0, ExecutablePath().find_last_of(L"\\") );
+ _wchdir(workingdirectory.c_str());
+
wstring path = ExecutablePath();
path.resize(path.length() - 4);
path.erase(0, path.find_last_of(L"\\") + 1);
Please sign in to comment.
Something went wrong with that request. Please try again.