[wpkg-users] Old Feature Request / Perhaps New Idea
Heiko Helmle (horiba/eu)
heiko.helmle at horiba.com
Wed Feb 17 14:47:59 CET 2010
Hello Stefan,
Thanks for your reply -
> > Well - the start-menu part is saved in the registry:
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
> \Explorer\Shell Folders\Common Programs
> >
> > If WPKG could expand some of those paths ("Common Desktop" would
> > also be very useful), this could simplify lots of install scripts.
> You may want to open a command prompt and execute the SET command.
> You will notice the following environment variables: USERPROFILE and
> ALLUSERSPROFILE
... Which expand only to a part of the needed path. And the part missing
is localized. I already searched all the standard env-variables for useful
stuff, but localization bites me all the time.
> The ALLUSERSPROFILE will point the root folder for the common
> desktop, so using %ALLUSERSPROFILE%\Desktop will work on any
> localization, since it works for me on German and English localizations.
... As long as the Desktop ist in the path ".\Desktop". I didn't check
(yet) but I bet, French XP might not be called "Desktop".
And even in ENU/DEU it doesn't work for the Start Menu - but the registry
entry "Common Programs" and "Common Start Menu" always points to the
global equivalents.
And for added bonus - those entries work in Win7 - for shortcuts you won't
have to check what Win-Version you're on - just expand the registry
values.
you can workaround this with a vbscript using something like this:
--snip--
dim oShell
set oShell = WScript.CreateObject("Wscript.shell")
commonPrograms =
oShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell
Folders\Common Programs")
oshell.run "%COMSPEC% /C del " & commonPrograms & "\shortcut.lnk", 1, true
--snip--
but would'nt it be nice just to use
<install cmd="%COMSPEC% /C del %COMMON_START_MENU%\shortcut.lnk" />
or maybe
<regexpand path="
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell
Folders\Common Startup" value="STARTUP" />
<install cmd="%COMSPEC% /C del "%STARTUP%\StupidApp.lnk" />
> On the other hand you can create JS scripts to create shortcuts, see
> http://wpkg.org/Category:Utility_Scripts for an example of such a
> script for desktop shortcuts.
Well - this won't help if you want to delete shortcuts, or move them
around, or do something in the global appdata (which is different on XP
from 7).
Most Installers already create shortcuts - but often too many or in
wrong/unwanted places. Or place stuff in the Startup-Folder.
I just thought this might be a pretty simple (and possibly useful)
addition, that could save lots of external extra-scripting.
Best Regards
Heiko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20100217/d34404b4/attachment-0002.html>
More information about the wpkg-users
mailing list