according to MSDN, passing NULL as hModule to GetModuleFileName will get the path for the executable of the process so there's no need for g_hInstance
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4904 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
d01e124228
commit
0243b40a1d
2 changed files with 2 additions and 2 deletions
|
@ -216,7 +216,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
if (m_Err) // not done yet
|
||||
{
|
||||
// get current name
|
||||
int l=GetModuleFileName(g_hInstance,ibuf,sizeof(ibuf));
|
||||
int l=GetModuleFileName(NULL,ibuf,sizeof(ibuf));
|
||||
// check if it is ?Au_.exe - if so, fuck it
|
||||
if (!lstrcmpi(ibuf+l-(sizeof(s)-2),s+1)) break;
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ const char * NSISCALL loadHeaders(int cl_flags)
|
|||
|
||||
HANDLE db_hFile;
|
||||
|
||||
GetModuleFileName(g_hInstance, state_exe_directory, NSIS_MAX_STRLEN);
|
||||
GetModuleFileName(NULL, state_exe_directory, NSIS_MAX_STRLEN);
|
||||
|
||||
g_db_hFile = db_hFile = myOpenFile(state_exe_directory, GENERIC_READ, OPEN_EXISTING);
|
||||
if (db_hFile == INVALID_HANDLE_VALUE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue