- NSIS Discussion
- 2 questions: 1) Where is the "\". 2)Detect "no create shortcuts".
Archive: 2 questions: 1) Where is the "\". 2)Detect "no create shortcuts".
Joel
15th March 2003 18:14 UTC
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? :igor:
2. How can the Nsis detect if the user check
for "no shortcuts in
start menu" for installing another files?
:cool:
Afrow UK
15th March 2003 18:35 UTC
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
15th March 2003 19:03 UTC
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
15th March 2003 19:15 UTC
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
15th March 2003 19:20 UTC
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
:up:
deguix
15th March 2003 19:29 UTC
:down: +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 isnt checked, will execute this code below:
>End:
;When it is or not checked, will execute this code below:
>FunctionEnd
>
Joel
15th March 2003 19:32 UTC
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.
Afrow UK
16th March 2003 13:03 UTC
On labels, use \\ to make a \.
-Stuart
Joel
16th March 2003 18:03 UTC
yeah! no wonder :p
deguix
16th March 2003 20:47 UTC
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
18th March 2003 23:47 UTC
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 :D
Weird: C:pathhi :igor:
anyone know the trick to put *auto* the \?
thanks
deguix
19th March 2003 07:20 UTC
Use the StrReplace Function in Archive.
Joel
19th March 2003 19:13 UTC
already done that :p