Old 16th October 2004, 22:00   #1
SupSuper
Junior Member
 
Join Date: Jun 2004
Posts: 12
Send a message via ICQ to SupSuper Send a message via Yahoo to SupSuper
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.
SupSuper is offline   Reply With Quote
Old 17th October 2004, 10:59   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
The Start Menu folder variable will be prefixed with a '>' character.
Joost Verburg is offline   Reply With Quote
Old 15th March 2012, 14:28   #3
AldoRay
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.
AldoRay is offline   Reply With Quote
Old 15th March 2012, 16:01   #4
Anders
Moderator
 
Anders's Avatar
 
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
Anders is offline   Reply With Quote
Old 15th March 2012, 17:25   #5
AldoRay
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.
AldoRay is offline   Reply With Quote
Old 15th March 2012, 18:44   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
Quote:
Originally Posted by AldoRay View Post
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.
If the checkbox is not checked you should not add anything to the startmenu, that is the whole point of the checkbox.

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
Anders is offline   Reply With Quote
Old 16th March 2012, 07:54   #7
AldoRay
Junior Member
 
Join Date: Mar 2012
Posts: 5
Hi Anders,

again thank you for your quick reply.

Quote:
Originally Posted by Anders View Post
If the checkbox is not checked you should not add anything to the startmenu, that is the whole point of the checkbox.
This must be a misunderstanding. Again: the reason to check the checkbox variable is to NOT install the URL startmenu link in that case.

Quote:
Originally Posted by Anders View Post
Using $0 is not a good idea, make your own variable with Var.
Understood.

Quote:
Originally Posted by Anders View Post
MUI_STARTMENU_GETFOLDER is for the uninstaller, in the installer you can just check the variable directly.
Sorry to be so ignorant How would I do that?
AldoRay is offline   Reply With Quote
Old 16th March 2012, 10:59   #8
Anders
Moderator
 
Anders's Avatar
 
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
Anders is offline   Reply With Quote
Old 16th March 2012, 12:28   #9
AldoRay
Junior Member
 
Join Date: Mar 2012
Posts: 5
Quote:
Originally Posted by Anders View Post
Yeah, a misunderstanding about the checkbox state, sorry about that.
Never mind. It's me who is asking questions about basic stuff

Quote:
Originally Posted by Anders View Post
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...
That's clear to me, thank you. What is still not clear to me is what this does mean:

Quote:
Originally Posted by Anders View Post
You provide the variable (MUI_PAGE_STARTMENU pageid variable)
What would I really write in my NSIS script to retreive the variable?

Would I write

code:
var /GLOBAL MuiPageStartMenuFolder
StrCpy $MuiPageStartMenuFolder "${MUI_STARTMENUPAGE_pageid_VARIABLE}" 1



Hm, I guess that won't work
AldoRay is offline   Reply With Quote
Old 16th March 2012, 15:37   #10
AldoRay
Junior Member
 
Join Date: Mar 2012
Posts: 5
Got it:
code:
${MUI_STARTMENUPAGE_Application_VARIABLE}


Thank you Anders!
AldoRay is offline   Reply With Quote
Old 16th March 2012, 20:21   #11
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
Why are you making this so hard?

Quote:
var /GLOBAL StartMenuFolder
...
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
...
StrCpy $0 $StartMenuFolder 1
StrCmp $0 ">" ...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump