From: <and...@us...> - 2024-08-09 14:06:49
|
Revision: 7438 http://sourceforge.net/p/nsis/code/7438 Author: anders_k Date: 2024-08-09 14:06:44 +0000 (Fri, 09 Aug 2024) Log Message: ----------- Accept .zip as command line parameter Modified Paths: -------------- NSIS/trunk/Contrib/zip2exe/SConscript NSIS/trunk/Contrib/zip2exe/main.cpp NSIS/trunk/Contrib/zip2exe/res.rc NSIS/trunk/Docs/src/history.but Modified: NSIS/trunk/Contrib/zip2exe/SConscript =================================================================== --- NSIS/trunk/Contrib/zip2exe/SConscript 2024-06-24 21:11:50 UTC (rev 7437) +++ NSIS/trunk/Contrib/zip2exe/SConscript 2024-08-09 14:06:44 UTC (rev 7438) @@ -16,6 +16,7 @@ libs = Split(""" advapi32 shell32 + shlwapi comctl32 comdlg32 user32 Modified: NSIS/trunk/Contrib/zip2exe/main.cpp =================================================================== --- NSIS/trunk/Contrib/zip2exe/main.cpp 2024-06-24 21:11:50 UTC (rev 7437) +++ NSIS/trunk/Contrib/zip2exe/main.cpp 2024-08-09 14:06:44 UTC (rev 7438) @@ -13,6 +13,7 @@ #include <stdio.h> #include <ctype.h> #include <commctrl.h> +#include <shlwapi.h> #ifndef COUNTOF #define COUNTOF(a) (sizeof(a)/sizeof(a[0])) @@ -19,6 +20,9 @@ #endif /* +version 0.39 (by Anders Kjersem) +* Accept .zip as command line parameter + version 0.38 (by Anders Kjersem) * Aborts if the zip file is encrypted @@ -601,7 +605,7 @@ } -void SetZip(HWND hwndDlg, TCHAR *path) +int SetZip(HWND hwndDlg, TCHAR *path) { TCHAR buf2[1024]; lstrcpy(buf2,path); @@ -618,10 +622,15 @@ } _tcscpy(t,_T(".exe")); SetDlgItemText(hwndDlg,IDC_OUTFILE,path); - if (tempzip_make(hwndDlg,buf2)) tempzip_cleanup(hwndDlg,1); + if (tempzip_make(hwndDlg,buf2)) + { + tempzip_cleanup(hwndDlg,1); + return 1; + } else { EnableWindow(GetDlgItem(hwndDlg,IDOK),1); + return 0; } } @@ -669,6 +678,18 @@ SendDlgItemMessage(hwndDlg,IDC_OUTPUTTEXT,WM_SETFONT,(WPARAM)hFont,0); DragAcceptFiles(hwndDlg,TRUE); + + { + LPTSTR args = PathGetArgs(GetCommandLine()); + TCHAR buf[100]; + lstrcpyn(buf, args, sizeof("/GENERATE")); + BOOL generate = !_tcsicmp(buf, _T("/GENERATE")); + args += generate ? sizeof("/GENERATE") : 0; + while (*args <= ' ' && *args) ++args; + PathUnquoteSpaces(args); + if (*args && !SetZip(hwndDlg, args) && generate) + PostMessage(hwndDlg, WM_COMMAND, IDOK, 0); + } return 1; case WM_NCDESTROY: DeleteObject(hIcon); hIcon=0; Modified: NSIS/trunk/Contrib/zip2exe/res.rc =================================================================== --- NSIS/trunk/Contrib/zip2exe/res.rc 2024-06-24 21:11:50 UTC (rev 7437) +++ NSIS/trunk/Contrib/zip2exe/res.rc 2024-08-09 14:06:44 UTC (rev 7438) @@ -29,7 +29,7 @@ IDD_DIALOG1 DIALOGEX 0, 0, 360, 271 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Zip2Exe 0.38" +CAPTION "Zip2Exe 0.39" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN ICON IDI_ICON1,IDC_NSISICON,6,6,20,20 Modified: NSIS/trunk/Docs/src/history.but =================================================================== --- NSIS/trunk/Docs/src/history.but 2024-06-24 21:11:50 UTC (rev 7437) +++ NSIS/trunk/Docs/src/history.but 2024-08-09 14:06:44 UTC (rev 7438) @@ -16,6 +16,8 @@ \b Make System/Resource.dll reproducible (\W{http://sf.net/p/nsis/patches/312}{patch #312}) +\b Zip2Exe accepts .zip as command line parameter + \S2{} Translations \b Updated Finnish (\W{http://sf.net/p/nsis/patches/313}{patch #313}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |