Archive: Asking user if they want to install on all acounts if admin.


Asking user if they want to install on all acounts if admin.
  Hi, thanks for the help on my previous post, I got everything sorted out on that.

Now, I have another question. What would be the best way to ask a user that has administrator rights on a Win2k system if they want to install on all accounts? And what would be the best way to actually install it globally across the accounts rather than just the one account (I'm talking of Start Menu stuff here, the files are installed globally anyways).


Also, how would I go about asking someone if they want to place things on their desktop before it actually placed?


Thanks for any help.


Okay, I managed to get it to ask you if you want to create desktop icons, the thing is, it goes to the label I made no matter what I press in the message box:


Section "Shortcuts"

;Add Shortcuts
CreateDirectory "$SMPROGRAMS\BYOND"
CreateShortCut "$SMPROGRAMS\BYOND\Dream Daemon.lnk" "$INSTDIR\bin\dreamdaemon.exe" "" "$INSTDIR\bin\dreamdaemon.exe" 0
CreateShortCut"$SMPROGRAMS\BYOND\Dream Maker.lnk" "$INSTDIR\bin\dreammaker.exe" "" "$INSTDIR\bin\dreammaker.exe" 0
CreateShortCut"$SMPROGRAMS\BYOND\Dream Seeker.lnk" "$INSTDIR\bin\dreamseeker.exe" "" "$INSTDIR\bin\dreamseeker.exe" 0
MessageBox MB_YESNO
|MB_ICONSTOP "Do you want to create desktop icons?" IDYES ".dsicon"
.dsicon:
CreateShortCut "$DESKTOP\Dream Seeker.lnk" "$INSTDIR\bin\dreamseeker.exe" "" "$INSTDIR\bin\dreamseeker.exe" 0
SectionEnd
>

Use SetShellVarContext to choose between all users and current user.

Currently you tell the messagebox to go to a useless label on YES and to continue on NO. You only have to handle IDNO (set a label after CreateShortcut or use +2).


Could you give me a small example on how to use labels? I'm used to using them in VB, and C++, where they're not called unless specfically goto'ed.


MessageBox MB_YESNO|MB_ICONSTOP "Do you want to create desktop icons?" IDNO noicons

...create icons...

noicons:


And in noicons: I would remove the icons, correct? From what I've seen labels are reached no matter what happens, which is no valid for a label in any language I've ever seen.


no, they will never be reached, if u jump around them.
so, u'll not have to remove the icons in noicons.
labels in nsis are just jumpto-points. like in ms-dos batch-files.


Oh! That makes sense, I see what it does, I feel stupid now, thanks a lot!