- Fixed uninstaller refusal to start when on the root directory (note that AllowRootDirInstall true is still required)
- Some touch ups regarding NSIS_CONFIG_VISIBLE_SUPPORT git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2896 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
aa09b6bdb9
commit
9d7de707ea
5 changed files with 40 additions and 15 deletions
|
@ -44,7 +44,10 @@ extern HANDLE dbd_hFile;
|
|||
|
||||
char g_caption[NSIS_MAX_STRLEN*2];
|
||||
int g_filehdrsize;
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
HWND g_hwnd;
|
||||
HANDLE g_hInstance;
|
||||
#endif
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, int nCmdShow)
|
||||
{
|
||||
|
@ -89,7 +92,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
|
||||
lstrcpyn(state_command_line, GetCommandLine(), NSIS_MAX_STRLEN);
|
||||
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
g_hInstance = GetModuleHandle(NULL);
|
||||
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
|
||||
cmdline = state_command_line;
|
||||
if (*cmdline == '\"') seekchar = *cmdline++;
|
||||
|
@ -139,6 +144,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
|
||||
while (p >= cmdline && (p[0] != '_' || p[1] != '?' || p[2] != '=')) p--;
|
||||
|
||||
m_Err = _LANG_UNINSTINITERROR;
|
||||
|
||||
if (p >= cmdline)
|
||||
{
|
||||
*(p-1)=0; // terminate before the " _?="
|
||||
|
@ -147,20 +154,20 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
{
|
||||
mystrcpy(state_install_directory, p);
|
||||
mystrcpy(state_output_directory, p);
|
||||
m_Err = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Err = _LANG_UNINSTINITERROR;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int x,done=0;
|
||||
int x;
|
||||
|
||||
for (x = 0; x < 26; x ++)
|
||||
{
|
||||
// File name need slash before coz temp dir was changed by validate_filename(...)
|
||||
// File name need slash before because temp dir was changed by validate_filename
|
||||
static char s[]="\\A~NSISu_.exe";
|
||||
static char buf2[NSIS_MAX_STRLEN*2];
|
||||
static char ibuf[NSIS_MAX_STRLEN];
|
||||
|
@ -171,7 +178,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
|
||||
DeleteFile(buf2+1); // clean up after all the other ones if they are there
|
||||
|
||||
if (!done)
|
||||
if (m_Err) // not done yet
|
||||
{
|
||||
// get current name
|
||||
int l=GetModuleFileName(g_hInstance,ibuf,sizeof(ibuf));
|
||||
|
@ -187,19 +194,23 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
#endif
|
||||
if (state_install_directory[0]) mystrcpy(ibuf,state_install_directory);
|
||||
else trimslashtoend(ibuf);
|
||||
done++;
|
||||
lstrcat(buf2,"\" ");
|
||||
lstrcat(buf2,realcmds);
|
||||
lstrcat(buf2," _?=");
|
||||
lstrcat(buf2,ibuf);
|
||||
// add a trailing backslash to make sure is_valid_instpath will not fail when it shouldn't
|
||||
lstrcat(buf2,"\\");
|
||||
hProc=myCreateProcess(buf2,state_temp_dir);
|
||||
if (hProc) CloseHandle(hProc);
|
||||
else m_Err = _LANG_UNINSTINITERROR;
|
||||
if (hProc)
|
||||
{
|
||||
CloseHandle(hProc);
|
||||
// success
|
||||
m_Err = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
s[0]++;
|
||||
}
|
||||
if (!done) m_Err = _LANG_UNINSTINITERROR;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,9 @@
|
|||
#define LB_ICONWIDTH 20
|
||||
#define LB_ICONHEIGHT 20
|
||||
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
HICON g_hIcon;
|
||||
#endif
|
||||
|
||||
int dlg_offset;
|
||||
|
||||
|
|
|
@ -191,10 +191,12 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
Sleep(max(x,1));
|
||||
}
|
||||
break;
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
case EW_BRINGTOFRONT:
|
||||
log_printf("BringToFront");
|
||||
SetForegroundWindow(g_hwnd);
|
||||
break;
|
||||
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
case EW_SETFLAG:
|
||||
g_exec_flags.flags[parm0]=GetIntFromParm(1);
|
||||
break;
|
||||
|
@ -207,10 +209,12 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
case EW_GETFLAG:
|
||||
myitoa(var0,g_exec_flags.flags[parm1]);
|
||||
break;
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
case EW_CHDETAILSVIEW:
|
||||
if (insthwndbutton) ShowWindow(insthwndbutton,parm1);
|
||||
if (insthwnd) ShowWindow(insthwnd,parm0);
|
||||
break;
|
||||
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
case EW_SETFILEATTRIBUTES: {
|
||||
char *buf1=GetStringFromParm(-0x10);
|
||||
log_printf3("SetFileAttributes: \"%s\":%08X",buf1,parm1);
|
||||
|
@ -944,12 +948,16 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
{
|
||||
void (*func)(HWND,int,char*,void*);
|
||||
func=(void*)funke;
|
||||
func(g_hwnd,NSIS_MAX_STRLEN,(char*)g_usrvars,
|
||||
func(
|
||||
g_hwnd,
|
||||
NSIS_MAX_STRLEN,
|
||||
(char*)g_usrvars,
|
||||
#ifdef NSIS_SUPPORT_STACK
|
||||
(void*)&g_st);
|
||||
(void*)&g_st
|
||||
#else
|
||||
NULL);
|
||||
#endif
|
||||
NULL
|
||||
#endif//NSIS_SUPPORT_STACK
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -16,7 +16,13 @@
|
|||
#endif
|
||||
|
||||
extern char g_caption[NSIS_MAX_STRLEN*2];
|
||||
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
|
||||
extern HWND g_hwnd;
|
||||
extern HANDLE g_hInstance;
|
||||
extern HWND insthwnd,insthwndbutton;
|
||||
extern HICON g_hIcon;
|
||||
extern HICON g_hIcon;
|
||||
#else
|
||||
#define g_hwnd 0
|
||||
#define g_hInstance 0
|
||||
#define g_hIcon 0
|
||||
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
|
@ -40,8 +40,6 @@ char g_log_file[1024];
|
|||
char *state_plugins_dir=g_usrvars[36];
|
||||
#endif
|
||||
|
||||
HANDLE g_hInstance;
|
||||
|
||||
#ifndef INVALID_FILE_ATTRIBUTES
|
||||
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue