Skip to content
⌘ NSIS Forum Archive

2 questions: 1) Where is the "\". 2)Detect "no create shortcuts".

13 posts

Joel#

2 questions: 1) Where is the "\". 2)Detect "no create shortcuts".

Two questions:

1. I write in an ini file a path from a folder.
When the installer read
the ini and retrived the value,
it printed like this "C:hellodir".
It suppost to be like this "C:\hello\dir.
Is this normal? 🧟

2. How can the Nsis detect if the user check
for "no shortcuts in
start menu" for installing another files?
😎
Afrow UK#
1. That is not normal, and I've never had that problem. Not sure why that is happening?
2. Not sure what you mean.

-Stuart
deguix#
1. This is strange, please give more details about this or attach the script.

2. I don't know. But this code can work (I didn't test before):

StrCpy $0 0
  !insertmacro MUI_STARTMENU_WRITE_BEGIN
    
    ;The shortcuts
    StrCpy $0 1
  !insertmacro MUI_STARTMENU_WRITE_END
  StrCmp $0 0 0 +2
    MessageBox MB_OK "NO SHORTCUTS CHECKED" 
[edit]I tested the code now, and it works![/edit]
kichik#
1) You are probably using a label. Notice the docs:

Text (optional) Specifies the caption of a label, checkbox, or radio button control. For icon and bitmaps control this specifies the path to the image.

Note: For labels, \r\n will be converted to a newline.
2) From StartMenu's Readme:

If the user checked the no shortcuts checkbox the '>' will be
appended to the folder name.
Joel#
Yes, it worked... but it's suppost to be:

StrCmp $0 0 0 +1
MessageBox MB_OK "NO SHORTCUTS CHECKED"
to jump to the first like, in this case your messagebox

👍
deguix#
👎 +1 is the same thing that 0, so will jump to next line, this mean that the message box always will be showed in your code.

And an alternative code to detect after you leave the Start Menu Page:

 !define MUI_CUSTOMFUNCTION_STARTMENU_LEAVE "CheckedDetect"
Function CheckedDetect
  Push $0
  
    StrCpy $0 ${MUI_STARTMENUPAGE_VARIABLE} 1
    StrCmp $0 ">" 0 NotChecked
  Pop $0
;When it is checked, will execute this code below:
MessageBox MB_OK "NO SHORTCUTS CHECKED"
Goto End
NotChecked:
;When it isn't checked, will execute this code below:
End:
;When it is or not checked, will execute this code below:
FunctionEnd 
Joel#
let me explain my self....

After the start-menu page, I show a custom page with some info.
captured by Nsis (Windows name, user name, ram, IE ver, installdir,
etc.) and I wanna put a static label with "yes" or "no" if the user
select the "start menu" checkbox.
deguix#
The codes that I'd posted here are at Archive too, plus a function to those that don't have the Modern UI:

How to detect if "Do not create shortcuts" is checked

Or see my signature below:
Joel#
ok, I know that \\ = \ in IO.
But I wanna write a label text to put the $INSTDIR.
And always return something like this:
Normal: C:\path\hi 😁
Weird: C😛athhi 🧟

anyone know the trick to put *auto* the \?

thanks