From 37a03e4fac93bdc9eb859394b6fec3362f1cca22 Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 30 Jan 2003 18:42:36 +0000 Subject: [PATCH] No more problems for directories with a name starting with "error" git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2096 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Modern UI/System.nsh | 18 +++++++++++------- Contrib/StartMenu/Example.nsi | 13 +++++++++---- Contrib/StartMenu/Readme.txt | 9 ++++++--- Contrib/StartMenu/StartMenu.c | 1 + Plugins/StartMenu.dll | Bin 6656 -> 6656 bytes 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Contrib/Modern UI/System.nsh b/Contrib/Modern UI/System.nsh index d5910bc6..76073e5a 100644 --- a/Contrib/Modern UI/System.nsh +++ b/Contrib/Modern UI/System.nsh @@ -1088,6 +1088,8 @@ !endif Function "${SETSTARTMENU}" + + Push ${MUI_TEMP1} !insertmacro MUI_HEADER_TEXT $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE) @@ -1095,21 +1097,23 @@ !ifdef MUI_STARTMENU_REGISTRY_KEY !ifdef MUI_STARTMENU_REGISTRY_VALUENAME - StrCmp "${MUI_STARTMENU_VARIABLE}" "" "" +6 - - Push ${MUI_TEMP1} + StrCmp "${MUI_STARTMENU_VARIABLE}" "" "" +4 + ReadRegStr ${MUI_TEMP1} "${MUI_STARTMENU_REGISTRY_ROOT}" "${MUI_STARTMENU_REGISTRY_KEY}" "${MUI_STARTMENU_REGISTRY_VALUENAME}" StrCmp ${MUI_TEMP1} "" +2 StrCpy "${MUI_STARTMENU_VARIABLE}" ${MUI_TEMP1} - Pop ${MUI_TEMP1} - + !endif !endif !endif StartMenu::Select /noicon /autoadd /text "$(MUI_INNERTEXT_STARTMENU_TOP)" /lastused "${MUI_STARTMENU_VARIABLE}" /checknoshortcuts "$(MUI_INNERTEXT_STARTMENU_CHECKBOX)" "${MUI_STARTMENU_DEFAULTFOLDER}" - Pop "${MUI_STARTMENU_VARIABLE}" - + Pop ${MUI_TEMP1} + StrCmp ${MUI_TEMP1} "success" 0 +2 + Pop "${MUI_STARTMENU_VARIABLE}" + + Pop ${MUI_TEMP1} + FunctionEnd !ifndef MUI_NOVERBOSE diff --git a/Contrib/StartMenu/Example.nsi b/Contrib/StartMenu/Example.nsi index 12594bf1..b9b65dd9 100644 --- a/Contrib/StartMenu/Example.nsi +++ b/Contrib/StartMenu/Example.nsi @@ -15,16 +15,21 @@ FunctionEnd Page custom StartMenuGroupSelect ": Start Menu Folder" Function StartMenuGroupSelect + Push $R1 + StartMenu::Select /checknoshortcuts "Don't create a start menu folder" /autoadd /lastused $R0 "StartMenu.dll test" Pop $R1 - StrCpy $R2 $R1 5 - StrCmp $R2 "error" 0 +3 + StrCmp $R1 "success" success + StrCmp $R1 "cancel" done ; error MessageBox MB_OK $R1 Return - StrCpy $R0 $R1 ; got the dir, or cancel, but if it's cancel NSIS will exit and - ; then we shouldn't care about the value of $R0 + success: + Pop $R0 + + done: + Pop $R1 FunctionEnd Page instfiles diff --git a/Contrib/StartMenu/Readme.txt b/Contrib/StartMenu/Readme.txt index 2fbe11a6..af1cd51e 100644 --- a/Contrib/StartMenu/Readme.txt +++ b/Contrib/StartMenu/Readme.txt @@ -15,9 +15,12 @@ which is the program group default name, and some more optional parameters: will have > as its first character and you should not create the program group. -The function pushes the folder selection back to the stack. It does not push the -full path but only the selected sub-folder. It's up to you to decide if to put -it in the current user or all users start menu. +The function pushes "success", "cancel" or an error to the stack. If there was no +error and the user didn't press on cancel it will push the selected folder name +after "success". If the user checked the no shortcuts checkbox the '>' will be +appended to the folder name. The function does not push the full path but only the +selected sub-folder. It's up to you to decide if to put it in the current user or +all users start menu. Look at Example.nsi for an example. diff --git a/Contrib/StartMenu/StartMenu.c b/Contrib/StartMenu/StartMenu.c index 07f4c21c..ca73b2e5 100644 --- a/Contrib/StartMenu/StartMenu.c +++ b/Contrib/StartMenu/StartMenu.c @@ -285,6 +285,7 @@ BOOL CALLBACK dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) else *buf = 0; GetWindowText(hwLocation, buf + (*buf ? 1 : 0), MAX_PATH); pushstring(buf); + pushstring("success"); } break; } diff --git a/Plugins/StartMenu.dll b/Plugins/StartMenu.dll index ec7d9a907a9a535cd72561f6c1eac797b288b942..f16bdb313fbbf7b75a40fac79cc6ad8e6bd1ca89 100644 GIT binary patch delta 683 zcmXX@ZAep57(VBA_myMb#FY?A;-av`?0ns6%4o8(5(I4}i9cM8VG5cPEfR&T$+E~e zQi2d%{82<7;05VNl%yHhkFpd#Wc5A5={>YfMs?lRO6~QscMzCK- z*k!-&ldBA8mO!-)B@j1jA^yO8y7Gi@Kbjux6&VWRCIHf}ypsVyzkQJ|r87=a`P!Ax zs#qgYY8XcCH(j(tKeqs2kcnd9;*1K_lF4>QP+R7e7UoENSvQPVvg?PKNe=Ru#S2^X zDa#-fiwA6b#edCq26pNRTb2ZCIJDgI3;RFHDn#W7r!kF@YlezTF2$9I`B@ z&Z1j079~qtdmwPGtxZp6?u5Eydra!iL;1*qe5eZfQ9TNxCe(!@s2@E9A;0o-=4Y(C|;4a*YIUd0;@f-Xef5u6?g4eN?Y$I8ukd%>1Qb*2{ z3#6OG$N(84qvRQxB(KRdnIjA256Nz(duRc5Q!lNcLE1rY(pz+hYV;m`L`UgUIzgxC zTRKBO(M9^5F4Hxd$qusyc9})lRW`ten8xn1DK^IzSc0uFMa62ldR%Q)FR9&XOdU`) R^|AUyomH1q$;~yX=O2_h;_Ltb delta 664 zcmXYuT}YEr7{||9@8-<4-o&K{YSxIpTb<9T1It(+cwt&AQ$j6ttc60;vIwm$VT{Oe zAiXGK8PB0yLy^&BdEg2Hwh4gl&J#e0j|MTbf{2xv`ZpWR|`6HtV z7x-V(z?z>1O#rNyLhhP4DizR>M8GyZQi7BS-9eDk9Z(`)SV^ALy-F zlZw0{2T*;WBAla?0JZm`K*|N!B)XJc&@0|5gPD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