|
|
|
|
#1 |
|
Junior Member
Join Date: Jun 2003
Posts: 46
|
What field to check in my StartMenuLeave function?
MUI 1.65, I updated via CVS this morning. Win98SE here.
I am using the logic of the StartMenu.nsi and I build on that. My StartMenuLeave function is shown below. My problem is that I don't know where to find the folder name entered (or selected) by the user. MUI_STARTMENUPAGE_VARIABLE contains the previous value entered (or selected) by the user. This is my first Leave function, and I cannot find the answer. ; validate the Start Menu folder entered (or selected) by the user Function StartMenuLeave MessageBox MB_OK "at1 MUI_STARTMENUPAGE_VARIABLE = ${MUI_STARTMENUPAGE_VARIABLE}" ;debug StrCmp ${MUI_STARTMENUPAGE_VARIABLE} "${MUI_PRODUCT}" PathGood StrCmp ${MUI_STARTMENUPAGE_VARIABLE} "" PathBad Push ${MUI_STARTMENUPAGE_VARIABLE} Call GetFileName ; get last part of path Pop $R0 ;$R0 is now "last part of path" StrCmp $R0 "${MUI_PRODUCT}" PathGood PathBad: MessageBox MB_OK|MB_ICONSTOP "Problem with folder name. The Start Menu folder (or sub-folder) must be ${MUI_PRODUCT}" Abort ; stay on page PathGood: FunctionEnd Thank you, Lilla |
|
|
|
|
|
#2 |
|
Major Dude
|
Exacly which part of the script is not working? I compiled the script and it seemed to behave properly unless I/m missing something.
Could you post your script to see if there is some problem with it. Vytautas NOTE: You can also use the $9 variable to access the selected forder. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jun 2003
Posts: 46
|
Steps to reproduce the problem:
1. Add my function to StartMenu.nsi, along with this line !define MUI_CUSTOMFUNCTION_STARTMENU_LEAVE StartMenuLeave 2. Compile and Run. 3. When the start menu page is displayed, change the default Start Menu Folder. For example, if 'Modern UI test' is displayed, change it to 'Modern UI test #2'. Then press the Next button. 4. Observe now, the message displayed in StartMenuLeave function. The message says: "at1 MUI_STARTMENUPAGE_VARIABLE = Modern UI test", or "at1 MUI_STARTMENUPAGE_VARIABLE = <empty>" if you are running it for the first time. Or, "at1 MUI_STARTMENUPAGE_VARIABLE = <value from last run>" Observe the problem: what is displayed IS NOT WHAT YOU JUST TYPED INTO THE FIELD! Conclusion: the function is not using the variable that contains the field the user entered. |
|
|
|
|
|
#4 |
|
Major Dude
|
OK, This is a newly introduced bug, e.g. this script works fine with the CSV(2003-06-24) but not with the CSV(2003-06-27). Sorry I didn't check this before. Its up to the DEV Team to fix this bug.
Vytautas
Last edited by Vytautas; 27th June 2003 at 07:34. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jun 2003
Posts: 46
|
That sounds right. A few days ago I reported a problem with 'Abort' in Leave function. The 'Abort' problem was fix, and then this new problem showed up.
Perhaps this information will help the developers know where to look. Thanks, Lilla |
|
|
|
|
|
#6 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
The custom function now uses the real leave function, which is being called before the StartMenu plug-in quits (you should be able to abort). We'll have a look at it.
|
|
|
|
|
|
#7 | |
|
Major Dude
|
Quote:
Vytautas |
|
|
|
|
|
|
#8 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
MUI_STARTMENUPAGE_VARIABLE is set after StartMenu quits. The MUI leave function is now called from the real leave function and not after StartMenu quits, thus the problem.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Jun 2006
Location: Cologne/Germany
Posts: 4
|
Is it possible, that this bug (described 06-27-2003 05:02 AM) appears again in version 2.33?
|
|
|
|
|
|
#10 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
As I said, the variable is set only after the StartMenu plug-in quits. If you want to get the value in the leave callback function, you must manually retrieve it using GetDlgItem and ${WM_GETTEXT}.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Jun 2006
Location: Cologne/Germany
Posts: 4
|
Wow, there had been some mantraps, but I've solved the problem.
Thank you for your hint kichik. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|