![]() |
#1 |
Junior Member
Join Date: Apr 2018
Posts: 6
|
Create shortcut optionally by commandline
Hi,
I try to add a command line option to enable Shortcut Creation in my NSIS script - but it's not working as expected. I use the SHOWREADME options to show the checkbox in the last page of the installation wizard - and add the following line to Init function code: But it seems that the command code: do not work at this part of the script - the checkbox is always checked! Also if if use the checked command line option - how can I customize my script that it use my command line option? Can I set the value for MUI_FINISHPAGE_SHOWREADME_NOTCHECKED? Thanks in advance Oliver |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
You cannot use a define like that. You must toggle the checkbox in the finish page show callback function.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Apr 2018
Posts: 6
|
Ok thanks for your replay - and how can I do this? Short code example would be very helpful - thanks again
|
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
PHP Code:
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Apr 2018
Posts: 6
|
Thanks for the quick replies and the script - but unfortunately it is not working correctly
$mui.FinishPage.ShowReadme is always empty - I put a messagebox in my script to show the content of this variable - always empty - I run it with NSIS 2.x... |
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
It worked in NSIS 3 when I tried. Download WinSpy++ and get the id of the control and use the GetDlgItem instead like I did with MUI v1 as an alternative.
$mui.FinishPage.ShowReadme is only valid in the show and leave callback for the finish page. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Apr 2018
Posts: 6
|
I removed everything not needed in my script and tried again with NSIS 3.03 - the messagebox pop up before the first page is displayed (is this really correct?) - perhaps you can find the issue - this is my script that I'm trying to run - add only one example file (sync.txt) as content - and perhaps you can also tell me if this will also work in silent mode - i guess it will not work - that would be my next question
![]() code: |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
You put the MUI_FINISHPAGE_SHOWREADME defines too early in the .nsi, they must come right before the insertmacro finishpage line. Look at my example!
MUI_PAGE_CUSTOMFUNCTION_SHOW is a generic macro define and only applies to the next page and you must place it correctly! IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Apr 2018
Posts: 6
|
Ok thanks a lot - now it works - really great support
![]() Is there any chance to disable it also using silent mode? (/S /NoShortcut=1)? |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Apr 2018
Posts: 6
|
Seems to work also in silent mode
![]() |
![]() |
![]() |
![]() |
#11 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
LogicLib.nsh has a if check for silent you can use if you want to detect just /S
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
|
Tags |
command line options, nsis, shortcut |
Thread Tools | Search this Thread |
Display Modes | |
|
|