Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update data/win/launch/launch.cpp #189

Merged
merged 1 commit into from

2 participants

@josiasmontag

Changes the working directory to the location of the exe file
Fixes: https://github.com/appjs/appjs/issues/188

@josiasmontag josiasmontag 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
a548820
@Benvie Benvie merged commit f585f7c into appjs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 20, 2012
  1. @josiasmontag

    Update data/win/launch/launch.cpp

    josiasmontag authored
    Changes the working directory to the location of the exe file
    Fixes: https://github.com/appjs/appjs/issues/188
This page is out of date. Refresh to see the latest.
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);
Something went wrong with that request. Please try again.