Updating works with b1, and MakeNSISw compiles without PSDK
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1974 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
740deb8042
commit
ff5553fa65
3 changed files with 45 additions and 37 deletions
|
@ -547,6 +547,11 @@ DWORD CALLBACK UpdateThread(LPVOID v) {
|
||||||
JNL_HTTPGet *get = new JNL_HTTPGet(g_dns,8192,(p&&p[0])?p:NULL);;
|
JNL_HTTPGet *get = new JNL_HTTPGet(g_dns,8192,(p&&p[0])?p:NULL);;
|
||||||
lstrcpy(url,NSIS_UPDATE);
|
lstrcpy(url,NSIS_UPDATE);
|
||||||
lstrcat(url,g_sdata.brandingv);
|
lstrcat(url,g_sdata.brandingv);
|
||||||
|
p=my_strstr(url," (CVS)");
|
||||||
|
if (p) {
|
||||||
|
*p=0;
|
||||||
|
lstrcat(url,"&cvs=1");
|
||||||
|
}
|
||||||
lstrcpy(response,"");
|
lstrcpy(response,"");
|
||||||
get->addheader("User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)");
|
get->addheader("User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)");
|
||||||
get->addheader("Accept:*/*");
|
get->addheader("Accept:*/*");
|
||||||
|
|
|
@ -88,7 +88,7 @@ BEGIN
|
||||||
MENUITEM "Browse Script\tCtrl+B", IDM_BROWSESCR
|
MENUITEM "Browse Script\tCtrl+B", IDM_BROWSESCR
|
||||||
MENUITEM "Clear &Log Window\tCtrl+W", IDM_CLEARLOG
|
MENUITEM "Clear &Log Window\tCtrl+W", IDM_CLEARLOG
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Check for &Update", IDM_UPDATE
|
MENUITEM "Check for &Update", IDM_UPDATE
|
||||||
END
|
END
|
||||||
POPUP "&Help"
|
POPUP "&Help"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -128,9 +128,10 @@ END
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
DLG_MAIN DIALOGEX DISCARDABLE 0, 0, 361, 228
|
DLG_MAIN DIALOG DISCARDABLE 0, 0, 361, 228
|
||||||
STYLE DS_SHELLFONT | DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
|
STYLE DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX |
|
||||||
WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
|
||||||
|
WS_THICKFRAME
|
||||||
CAPTION "MakeNSIS"
|
CAPTION "MakeNSIS"
|
||||||
MENU IDM_MENU
|
MENU IDM_MENU
|
||||||
FONT 8, "MS Shell Dlg"
|
FONT 8, "MS Shell Dlg"
|
||||||
|
@ -144,10 +145,11 @@ BEGIN
|
||||||
PUSHBUTTON "Test &Installer",IDC_TEST,230,208,60,15,WS_DISABLED
|
PUSHBUTTON "Test &Installer",IDC_TEST,230,208,60,15,WS_DISABLED
|
||||||
END
|
END
|
||||||
|
|
||||||
DLG_ABOUT DIALOGEX DISCARDABLE 0, 0, 233, 126
|
DLG_ABOUT DIALOGEX 0, 0, 233, 126
|
||||||
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CAPTION
|
STYLE DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP |
|
||||||
|
WS_CAPTION
|
||||||
CAPTION "About MakeNSISW"
|
CAPTION "About MakeNSISW"
|
||||||
FONT 8, "MS Shell Dlg"
|
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Clo&se",IDOK,180,104,43,15
|
DEFPUSHBUTTON "Clo&se",IDOK,180,104,43,15
|
||||||
LTEXT "MakeNSISW",IDC_ABOUTVERSION,14,31,219,8
|
LTEXT "MakeNSISW",IDC_ABOUTVERSION,14,31,219,8
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
freely, subject to the following restrictions:
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
claim that you wrote the original software. If you use this software
|
claim that you wrote the original software. If you use this software
|
||||||
in a product, an acknowledgment in the product documentation would be
|
in a product, an acknowledgment in the product documentation would be
|
||||||
appreciated but is not required.
|
appreciated but is not required.
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
misrepresented as being the original software.
|
misrepresented as being the original software.
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -89,9 +89,10 @@ void DisableItems(HWND hwnd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnableItems(HWND hwnd) {
|
void EnableItems(HWND hwnd) {
|
||||||
#define MSG(a) SendDlgItemMessage(hwnd,IDC_LOGWIN,a,0,0)
|
HWND hwLog = GetDlgItem(hwnd, IDC_LOGWIN);
|
||||||
#define MSG1(a,b) SendDlgItemMessage(hwnd,IDC_LOGWIN,a,b,0)
|
#define MSG(a) SendMessage(hwLog,a,0,0)
|
||||||
#define MSG2(a,b,c) SendDlgItemMessage(hwnd,IDC_LOGWIN,a,b,c)
|
#define MSG1(a,b) SendMessage(hwLog,a,b,0)
|
||||||
|
#define MSG2(a,b,c) SendMessage(hwLog,a,b,c)
|
||||||
if (g_sdata.input_script) {
|
if (g_sdata.input_script) {
|
||||||
GlobalFree(g_sdata.input_script);
|
GlobalFree(g_sdata.input_script);
|
||||||
g_sdata.input_script = 0;
|
g_sdata.input_script = 0;
|
||||||
|
@ -110,7 +111,7 @@ void EnableItems(HWND hwnd) {
|
||||||
ft.chrg.cpMin = tr.chrg.cpMin = MSG2(EM_FINDTEXT, 0, (LPARAM)&ft) + lstrlen("Processing script file: \"");
|
ft.chrg.cpMin = tr.chrg.cpMin = MSG2(EM_FINDTEXT, 0, (LPARAM)&ft) + lstrlen("Processing script file: \"");
|
||||||
ft.lpstrText = "\"";
|
ft.lpstrText = "\"";
|
||||||
tr.chrg.cpMax = MSG2(EM_FINDTEXT, 0, (LPARAM)&ft);
|
tr.chrg.cpMax = MSG2(EM_FINDTEXT, 0, (LPARAM)&ft);
|
||||||
if (tr.chrg.cpMin == lstrlen("Processing script file: \"") - 1) tr.chrg.cpMax = tr.chrg.cpMin = 0;
|
if (tr.chrg.cpMin == lstrlen("Processing script file: \"") - 1) tr.chrg.cpMax = tr.chrg.cpMin = 0;
|
||||||
tr.lpstrText = g_sdata.input_script = (char *)GlobalAlloc(GPTR, tr.chrg.cpMax-tr.chrg.cpMin+1);
|
tr.lpstrText = g_sdata.input_script = (char *)GlobalAlloc(GPTR, tr.chrg.cpMax-tr.chrg.cpMin+1);
|
||||||
MSG2(EM_GETTEXTRANGE, 0, (WPARAM)&tr);
|
MSG2(EM_GETTEXTRANGE, 0, (WPARAM)&tr);
|
||||||
|
|
||||||
|
@ -121,7 +122,7 @@ void EnableItems(HWND hwnd) {
|
||||||
ft.chrg.cpMin = tr.chrg.cpMin = MSG2(EM_FINDTEXT, 0, (LPARAM)&ft) + lstrlen("Output: \"");
|
ft.chrg.cpMin = tr.chrg.cpMin = MSG2(EM_FINDTEXT, 0, (LPARAM)&ft) + lstrlen("Output: \"");
|
||||||
ft.lpstrText = "\"";
|
ft.lpstrText = "\"";
|
||||||
tr.chrg.cpMax = MSG2(EM_FINDTEXT, 0, (LPARAM)&ft);
|
tr.chrg.cpMax = MSG2(EM_FINDTEXT, 0, (LPARAM)&ft);
|
||||||
if (tr.chrg.cpMin == lstrlen("Output: \"") - 1) tr.chrg.cpMax = tr.chrg.cpMin = 0;
|
if (tr.chrg.cpMin == lstrlen("Output: \"") - 1) tr.chrg.cpMax = tr.chrg.cpMin = 0;
|
||||||
tr.lpstrText = g_sdata.output_exe = (char *)GlobalAlloc(GPTR, tr.chrg.cpMax-tr.chrg.cpMin+1);
|
tr.lpstrText = g_sdata.output_exe = (char *)GlobalAlloc(GPTR, tr.chrg.cpMax-tr.chrg.cpMin+1);
|
||||||
MSG2(EM_GETTEXTRANGE, 0, (WPARAM)&tr);
|
MSG2(EM_GETTEXTRANGE, 0, (WPARAM)&tr);
|
||||||
|
|
||||||
|
@ -145,7 +146,7 @@ void EnableItems(HWND hwnd) {
|
||||||
EnableMenuItem(g_sdata.menu,IDM_COPYSELECTED,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_COPYSELECTED,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_EDITSCRIPT,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_EDITSCRIPT,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_CLEARLOG,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_CLEARLOG,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_BROWSESCR,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_BROWSESCR,MF_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompileNSISScript() {
|
void CompileNSISScript() {
|
||||||
|
@ -167,12 +168,12 @@ void CompileNSISScript() {
|
||||||
if (s) GlobalFree(s);
|
if (s) GlobalFree(s);
|
||||||
s = (char *)GlobalAlloc(GPTR, lstrlen(g_sdata.script)+sizeof(EXENAME)+2);
|
s = (char *)GlobalAlloc(GPTR, lstrlen(g_sdata.script)+sizeof(EXENAME)+2);
|
||||||
wsprintf(s,"%s %s",EXENAME,g_sdata.script);
|
wsprintf(s,"%s %s",EXENAME,g_sdata.script);
|
||||||
if (g_sdata.script_alloced) GlobalFree(g_sdata.script);
|
if (g_sdata.script_alloced) GlobalFree(g_sdata.script);
|
||||||
g_sdata.script_alloced = true;
|
g_sdata.script_alloced = true;
|
||||||
g_sdata.script = s;
|
g_sdata.script = s;
|
||||||
g_sdata.appended = TRUE;
|
g_sdata.appended = TRUE;
|
||||||
}
|
}
|
||||||
g_sdata.logLength = 0;
|
g_sdata.logLength = 0;
|
||||||
// Disable buttons during compile
|
// Disable buttons during compile
|
||||||
DisableItems(g_sdata.hwnd);
|
DisableItems(g_sdata.hwnd);
|
||||||
DWORD id;
|
DWORD id;
|
||||||
|
@ -264,7 +265,7 @@ int InitBranding() {
|
||||||
|
|
||||||
void InitTooltips(HWND h) {
|
void InitTooltips(HWND h) {
|
||||||
if (h == NULL) return;
|
if (h == NULL) return;
|
||||||
my_memset(&g_tip,0,sizeof(NTOOLTIP));
|
my_memset(&g_tip,0,sizeof(NTOOLTIP));
|
||||||
g_tip.tip_p = h;
|
g_tip.tip_p = h;
|
||||||
INITCOMMONCONTROLSEX icx;
|
INITCOMMONCONTROLSEX icx;
|
||||||
icx.dwSize = sizeof(icx);
|
icx.dwSize = sizeof(icx);
|
||||||
|
@ -302,8 +303,8 @@ LRESULT CALLBACK TipHookProc(int nCode, WPARAM wParam, LPARAM lParam) {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return CallNextHookEx(g_tip.hook, nCode, wParam, lParam);
|
return CallNextHookEx(g_tip.hook, nCode, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowDocs() {
|
void ShowDocs() {
|
||||||
|
@ -317,21 +318,21 @@ void ShowDocs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int getProxyInfo(char *out) {
|
int getProxyInfo(char *out) {
|
||||||
DWORD v=0;
|
DWORD v=0;
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
if (RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",0,KEY_READ,&hKey) == ERROR_SUCCESS) {
|
if (RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",0,KEY_READ,&hKey) == ERROR_SUCCESS) {
|
||||||
DWORD l = 4;
|
DWORD l = 4;
|
||||||
DWORD t;
|
DWORD t;
|
||||||
if (RegQueryValueEx(hKey,"ProxyEnable",NULL,&t,(unsigned char *)&v,&l) == ERROR_SUCCESS && t == REG_DWORD) {
|
if (RegQueryValueEx(hKey,"ProxyEnable",NULL,&t,(unsigned char *)&v,&l) == ERROR_SUCCESS && t == REG_DWORD) {
|
||||||
l=8192;
|
l=8192;
|
||||||
if (RegQueryValueEx(hKey,"ProxyServer",NULL,&t,(unsigned char *)out,&l ) != ERROR_SUCCESS || t != REG_SZ) {
|
if (RegQueryValueEx(hKey,"ProxyServer",NULL,&t,(unsigned char *)out,&l ) != ERROR_SUCCESS || t != REG_SZ) {
|
||||||
v=0;
|
v=0;
|
||||||
*out=0;
|
*out=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else v=0;
|
else v=0;
|
||||||
out[8192-1]=0;
|
out[8192-1]=0;
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue