|
|
#1 |
|
Junior Member
|
Getting "Don't place shortcuts" checkbox's state
How do I get the state of the "Don't place shortcuts" checkbox in the MUI Startmenu page? I want to know so that my page, which allows the user to set which shortcuts he wants created, only shows up when that checkbox isn't checked.
|
|
|
|
|
|
#2 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
The Start Menu folder variable will be prefixed with a '>' character.
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Mar 2012
Posts: 5
|
Re: Getting "Don't place shortcuts" checkbox's state
Hello everybody.
Bringing up a very old thread. > The Start Menu folder variable will be prefixed with a '>' character. How do I read out the "Start Menu folder variable" when I'm not anymore in the start menu dialog? I want to put a URL entry to the start menu at the very end of the installation, but only if the user didn't check the "Don't place shortcuts" checkbox. Any hint very much appreciated. |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
You provide the variable (MUI_PAGE_STARTMENU pageid variable)
Ignoring the user is evil, why would you want to do this? IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Mar 2012
Posts: 5
|
Re: Getting "Don't place shortcuts" checkbox's state
Hello Anders,
thank you very much for your reply. > You provide the variable (MUI_PAGE_STARTMENU pageid variable) Excuse my ignorance, but I'm not yet familliar with NSIS speak. What do you mean by this? I could do !insertmacro MUI_STARTMENU_GETFOLDER Application $0 but I always get "MyApp" and never ">MyApp", regardless if I checked the "Don't place shortcuts" checkbox or not. > Ignoring the user is evil, why would you want to do this? Huh? That's exactly what I don't want to do, ignoring the user. I want to find out if he checked the box or not and ONLY create the URL shortcut, if he didn't. |
|
|
|
|
|
#6 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
Quote:
Using $0 is not a good idea, make your own variable with Var. MUI_STARTMENU_GETFOLDER is for the uninstaller, in the installer you can just check the variable directly. IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
|
#7 | ||
|
Junior Member
Join Date: Mar 2012
Posts: 5
|
Hi Anders,
again thank you for your quick reply. Quote:
Understood. Quote:
How would I do that?
|
||
|
|
|
|
|
#8 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
Yeah, a misunderstanding about the checkbox state, sorry about that.
Anyway, to check the variable just copy the first character into $0 with StrCpy and then compare $0 with ">". The reason > is used is because it is invalid in a path, so even without checking first, a call to createshortcut or writeinistr will just fail... IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#9 | ||
|
Junior Member
Join Date: Mar 2012
Posts: 5
|
Quote:
![]() Quote:
What would I really write in my NSIS script to retreive the variable? Would I write code: Hm, I guess that won't work |
||
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Mar 2012
Posts: 5
|
Got it:
code: Thank you Anders! |
|
|
|
|
|
#11 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
Why are you making this so hard?
![]() Quote:
IntOp $PostCount $PostCount + 1 |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|