PDA

View Full Version : CreateShortCut for All Users


Aarif
17th May 2001, 22:46
Hey there,

Does anyone know an easy way to create a shortcut under the "All Users" folder in WinNT/2K instead of the users' own start menu? The builtin $STARTMENU replacable parameters point to the users' own start menu.

Thanks,
Aarif

dbareis
17th May 2001, 23:50
As far as I can see NSIS needs to add variables for these items as I have suggested in the past...

This is what the VB script "SpecialFolders" returns:

The following special folders are provided with the Windows 95 and Microsoft Windows NT 4.0 operating systems:

AllUsersDesktop
AllUsersStartMenu
AllUsersPrograms
AllUsersStartup
Desktop
Favorites
Fonts
MyDocuments
NetHood
PrintHood
Programs
Recent
SendTo
StartMenu
Startup
Templates

These should probably be the minimum available and probably with these names as Microsoft selected them.

As I already have a site of my own with over 100 of my own free downloads I don't have time myself to do these things... But if someone does PLEASE ADD "COMSPEC" and preferably generic access to environment variables...

yazno
18th May 2001, 06:16
hi,
dbareis,

don't panic ;)

use this function until it is implemented in nsis
(will it ?)

;==============================
Function GetShellFolderPath
;==============================

;possible values for 'folder_name':
;Desktop, Personal, NetHood, PrintHood, Programs,
;'Start Menu', AppData,SendTo, Cache, Cookies, History,
;Favorites, Startup, Recent, Templates,'Local AppData',
;Fonts, 'My Music', 'My Video', 'My Pictures'
;(if the list is incomplete please post back)

StrCpy $0 "folder_name"

ClearErrors
ReadRegStr $1 HKCU \
"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "$0"

IfErrors lbl_na lbl_ok

lbl_na:
MessageBox MB_OK "ShellFolder-Path is not available!"
GoTo lbl_end

lbl_ok:
StrCmp $1 "" lbl_na
MessageBox MB_OK "$1"

lbl_end:
;------------------------------
FunctionEnd
;------------------------------

cu yzo

dbareis
18th May 2001, 10:09
Good workaround, it would be nice if all the handy little snippets were collected somewhere!

Koen van de Sande
18th May 2001, 17:47
Isn't TheMIKE working on collecting all these snippets?

yazno
18th May 2001, 19:17
hi,

i have set up a functions archive (currently 7 functions of myself which are included with PowerPiMPiT) on my page (click on Functions Included), feel free to visit/contribute to it.

cu yzo