Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60ff4cf

Browse files
committed
Relaunch 96112f4 with fix for Mac.
1 parent 62ab94f commit 60ff4cf

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/nw_package.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,17 @@ Package::Package()
118118
if (args.size() > 0) {
119119
self_extract_ = false;
120120
path_ = FilePath(args[0]);
121-
if (InitFromPath())
122-
return;
121+
} else {
122+
// Try to load from the folder where the exe resides.
123+
// Note: self_extract_ is true here, otherwise a 'Invalid Package' error
124+
// would be triggered.
125+
path_ = GetSelfPath().DirName();
126+
#if defined(OS_MACOSX)
127+
path_ = path_.DirName().DirName().DirName();
128+
#endif
123129
}
130+
if (InitFromPath())
131+
return;
124132

125133
// Finally we init with default settings.
126134
self_extract_ = false;

0 commit comments

Comments
 (0)