nsis - Three choices in shortcut options -
we have our installer choices create shortcuts 1) create shortcut current user 2) create shortcut users 3) not create shortcut
the first option checked default, if check other work well..the problem if check example 3rd option, move next page , come there 2 choices checked - 1st (default) , 3rd (selected).
i new nsis , can't find better way did code not friendly me. appreciate advice.
thanks,
this have in installation options .ini :
[field 5] type=groupbox left=1 right=-1 top=80 bottom=144 text="choice of shortcuts:" state="" [field 6] type=radiobutton left=10 right=-10 top=96 bottom=108 text="create shortcuts users" state=1 flags=group|notify [field 7] type=radiobutton left=10 right=-10 top=112 bottom=124 text="create shortcuts current user" state=0 flags=notify [field 8] type=radiobutton text="do not create shortcut" flags=notify state=0 left=10 right=-10 top=128 bottom=140
then later in nsis script:
intcmp $shortcutsforallusers 1 shortcutsforall shortcutsforcurrentuser shortcutsforcurrentuser shortcutsforall: setshellvarcontext goto done shortcutsforcurrentuser: setshellvarcontext current goto done noshortcuts: goto done done: functionend
the installoptions page should remember state long don't extract every time in page create callback function.
!include logiclib.nsh !include installoptions.nsh changeui "${nsisdir}\contrib\uis\modern.exe" function .oninit !insertmacro installoptions_extract_as "...\test.ini" "iosp.ini" functionend var shortcutmode page custom myshortcutpagecreate myshortcutpageleave page components page instfiles function myshortcutpagecreate !insertmacro installoptions_display "iosp.ini" functionend function myshortcutpageleave !insertmacro installoptions_read $0 "iosp.ini" "settings" "state" ${if} $0 > 0 intop $shortcutmode $0 - 6 ; map .ini field id 0 (or empty), 1 or 2 abort ${endif} functionend section ${if} $shortcutmode = 0 setshellvarcontext ${elseif} $shortcutmode = 1 setshellvarcontext current ${endif} ... sectionend
there problem design, setshellvarcontext current
might not map $smprograms correct startmenu folder because uac can elevate process different administrator user...
Comments
Post a Comment