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);;
|
||||
lstrcpy(url,NSIS_UPDATE);
|
||||
lstrcat(url,g_sdata.brandingv);
|
||||
p=my_strstr(url," (CVS)");
|
||||
if (p) {
|
||||
*p=0;
|
||||
lstrcat(url,"&cvs=1");
|
||||
}
|
||||
lstrcpy(response,"");
|
||||
get->addheader("User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)");
|
||||
get->addheader("Accept:*/*");
|
||||
|
|
|
@ -88,7 +88,7 @@ BEGIN
|
|||
MENUITEM "Browse Script\tCtrl+B", IDM_BROWSESCR
|
||||
MENUITEM "Clear &Log Window\tCtrl+W", IDM_CLEARLOG
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Check for &Update", IDM_UPDATE
|
||||
MENUITEM "Check for &Update", IDM_UPDATE
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
|
@ -128,9 +128,10 @@ END
|
|||
// Dialog
|
||||
//
|
||||
|
||||
DLG_MAIN DIALOGEX DISCARDABLE 0, 0, 361, 228
|
||||
STYLE DS_SHELLFONT | DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
|
||||
WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||
DLG_MAIN DIALOG DISCARDABLE 0, 0, 361, 228
|
||||
STYLE DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX |
|
||||
WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
|
||||
WS_THICKFRAME
|
||||
CAPTION "MakeNSIS"
|
||||
MENU IDM_MENU
|
||||
FONT 8, "MS Shell Dlg"
|
||||
|
@ -144,10 +145,11 @@ BEGIN
|
|||
PUSHBUTTON "Test &Installer",IDC_TEST,230,208,60,15,WS_DISABLED
|
||||
END
|
||||
|
||||
DLG_ABOUT DIALOGEX DISCARDABLE 0, 0, 233, 126
|
||||
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CAPTION
|
||||
DLG_ABOUT DIALOGEX 0, 0, 233, 126
|
||||
STYLE DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP |
|
||||
WS_CAPTION
|
||||
CAPTION "About MakeNSISW"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Clo&se",IDOK,180,104,43,15
|
||||
LTEXT "MakeNSISW",IDC_ABOUTVERSION,14,31,219,8
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
freely, subject to the following restrictions:
|
||||
|
||||
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
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
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.
|
||||
|
||||
*/
|
||||
|
@ -89,9 +89,10 @@ void DisableItems(HWND hwnd) {
|
|||
}
|
||||
|
||||
void EnableItems(HWND hwnd) {
|
||||
#define MSG(a) SendDlgItemMessage(hwnd,IDC_LOGWIN,a,0,0)
|
||||
#define MSG1(a,b) SendDlgItemMessage(hwnd,IDC_LOGWIN,a,b,0)
|
||||
#define MSG2(a,b,c) SendDlgItemMessage(hwnd,IDC_LOGWIN,a,b,c)
|
||||
HWND hwLog = GetDlgItem(hwnd, IDC_LOGWIN);
|
||||
#define MSG(a) SendMessage(hwLog,a,0,0)
|
||||
#define MSG1(a,b) SendMessage(hwLog,a,b,0)
|
||||
#define MSG2(a,b,c) SendMessage(hwLog,a,b,c)
|
||||
if (g_sdata.input_script) {
|
||||
GlobalFree(g_sdata.input_script);
|
||||
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.lpstrText = "\"";
|
||||
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);
|
||||
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.lpstrText = "\"";
|
||||
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);
|
||||
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_EDITSCRIPT,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() {
|
||||
|
@ -167,12 +168,12 @@ void CompileNSISScript() {
|
|||
if (s) GlobalFree(s);
|
||||
s = (char *)GlobalAlloc(GPTR, lstrlen(g_sdata.script)+sizeof(EXENAME)+2);
|
||||
wsprintf(s,"%s %s",EXENAME,g_sdata.script);
|
||||
if (g_sdata.script_alloced) GlobalFree(g_sdata.script);
|
||||
g_sdata.script_alloced = true;
|
||||
if (g_sdata.script_alloced) GlobalFree(g_sdata.script);
|
||||
g_sdata.script_alloced = true;
|
||||
g_sdata.script = s;
|
||||
g_sdata.appended = TRUE;
|
||||
}
|
||||
g_sdata.logLength = 0;
|
||||
g_sdata.logLength = 0;
|
||||
// Disable buttons during compile
|
||||
DisableItems(g_sdata.hwnd);
|
||||
DWORD id;
|
||||
|
@ -264,7 +265,7 @@ int InitBranding() {
|
|||
|
||||
void InitTooltips(HWND h) {
|
||||
if (h == NULL) return;
|
||||
my_memset(&g_tip,0,sizeof(NTOOLTIP));
|
||||
my_memset(&g_tip,0,sizeof(NTOOLTIP));
|
||||
g_tip.tip_p = h;
|
||||
INITCOMMONCONTROLSEX icx;
|
||||
icx.dwSize = sizeof(icx);
|
||||
|
@ -302,8 +303,8 @@ LRESULT CALLBACK TipHookProc(int nCode, WPARAM wParam, LPARAM lParam) {
|
|||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return CallNextHookEx(g_tip.hook, nCode, wParam, lParam);
|
||||
}
|
||||
return CallNextHookEx(g_tip.hook, nCode, wParam, lParam);
|
||||
}
|
||||
|
||||
void ShowDocs() {
|
||||
|
@ -317,21 +318,21 @@ void ShowDocs() {
|
|||
}
|
||||
|
||||
int getProxyInfo(char *out) {
|
||||
DWORD v=0;
|
||||
DWORD v=0;
|
||||
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 t;
|
||||
if (RegQueryValueEx(hKey,"ProxyEnable",NULL,&t,(unsigned char *)&v,&l) == ERROR_SUCCESS && t == REG_DWORD) {
|
||||
l=8192;
|
||||
if (RegQueryValueEx(hKey,"ProxyServer",NULL,&t,(unsigned char *)out,&l ) != ERROR_SUCCESS || t != REG_SZ) {
|
||||
v=0;
|
||||
*out=0;
|
||||
}
|
||||
}
|
||||
else v=0;
|
||||
out[8192-1]=0;
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
return v;
|
||||
if (RegQueryValueEx(hKey,"ProxyEnable",NULL,&t,(unsigned char *)&v,&l) == ERROR_SUCCESS && t == REG_DWORD) {
|
||||
l=8192;
|
||||
if (RegQueryValueEx(hKey,"ProxyServer",NULL,&t,(unsigned char *)out,&l ) != ERROR_SUCCESS || t != REG_SZ) {
|
||||
v=0;
|
||||
*out=0;
|
||||
}
|
||||
}
|
||||
else v=0;
|
||||
out[8192-1]=0;
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
return v;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue