"SetShellVarContext all" uses different directories for
install and uninstall in Windows 98 SE.
Current settings for install are:
$SMPROGRAMS: "C:\Windows\Startmenu\Program Files"
(should be "C:\Windows\All Users\Startmenu\Program
Files"
$DESKTOP: "C:\Windows\All Users\Desktop" (correct)
Current settings for uninstall are:
$SMPROGRAMS: "C:\Windows\Startmenu\Program Files"
(should be "C:\Windows\All Users\Startmenu\Program
Files"
$DESKTOP: "C:\Windows\Desktop" (should
be "C:\Windows\All Users\Desktop")
Especially with the different $DESKTOP values, the
uninstaller fails to remove the links on the desktop.
I tried it with Windows XP, too, and it worked all
correctly with "all users" settings. I currently have no
other systems available, but think this could be a bug in
Windows 95/98/ME also. Maybe someone else can
approve this.
Attached you find the (uncommented) script file to test.
P.S.: It seems like this bug was already reported with
request id 906777, but the description was
misunderstood.
bye, TDMFraggle
Script file for test
Logged In: YES
user_id=584402
After some playing around with the script you've attached,
I've found that the reason $DESKTOP shows the right value
for the installer but not for the uninstaller is that you
have a CreateShortcut line in your installer. I will keep
trying to figure out what's really behind this, but for now,
you can add a CreateShortcut line to the uninstaller before
using shell constants such as $DESKTOP.
Logged In: YES
user_id=1103375
Thanks for your hint. I tried it and it works fine.
Will this bug be fixed in a later version?
Logged In: YES
user_id=584402
Assuming I can find some way to work around this odd Windows
behavior, it will be fixed.
Logged In: YES
user_id=1230708
How exactly should the workaround look like?
If I add in the uninstaller section the following (as I
understood your hint):
CreateShortCut "c:\windows\Desktop\test.lnk"
"$INSTDIR\test.exe" "" "$INSTDIR\test.exe"
Delete "c:\windows\Desktop\test.lnk"
the Uninstaller well creates the link in case it did not
exist yet, but it does not remove it, altough I didn't use
any Shell variable.
Using NSIS 2.05 and Win98
Greetz
Jochen
Logged In: NO
Hello Jochen,
the workaround for a link on the desktop should look like this:
Section "Uninstall"
SetShellVarContext all
Delete "$DESKTOP\test.lnk"
CreateShortCut "$DESKTOP\test.lnk" "$INSTDIR\test.exe"
Delete "$DESKTOP\test.lnk"
SetShellVarContext current
Delete "$DESKTOP\test.lnk"
SectionEnd
bye, TDMFraggle
Logged In: YES
user_id=1230708
Hey TDMFraggle,
thank you for the quick answer!
Unfortunately your hint does not work entirely:
I placed your code before all other uninstall-orders in my
"Uninstall"-Section.
And really, it removes test.lnk on my Win98 Desktop, but
creates a new one at the same time, wich is not deleted.
I assigned a different icon to that shortcut created in the
uninstaller-section, to make this effect visible, otherwise
it seems that test.lnk remains just untouched.
Do I need to post the whole Installer-File?
Greetz
Jochen
Logged In: YES
user_id=584402
Put this above your code instead:
CreateShortcut $TEMP\temp.lnk $TEMP
Delete $TEMP\temp.lnk
Logged In: YES
user_id=1230708
No success :-( Icons still exist ...
here my complete Uninstaller-Code:
Section "Uninstall"
CreateShortCut "$TEMP\temp.lnk" "$TEMP"
Delete "$TEMP\temp.lnk"
Delete "$DESKTOP\Start Fernwartung.lnk"
Delete "$DESKTOP\Stop Fernwartung.lnk"
RMDir /r "$INSTDIR"
RMDir /r "$SMPROGRAMS\IT-Vogl"
DeleteRegKey HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
SectionEnd
(the reg-part in one line of course)
greetz
Jochen
Logged In: YES
user_id=1230708
No success :-( Icons still exist ...
here my complete Uninstaller-Code:
Section "Uninstall"
CreateShortCut "$TEMP\temp.lnk" "$TEMP"
Delete "$TEMP\temp.lnk"
Delete "$DESKTOP\Start Fernwartung.lnk"
Delete "$DESKTOP\Stop Fernwartung.lnk"
RMDir /r "$INSTDIR"
RMDir /r "$SMPROGRAMS\IT-Vogl"
DeleteRegKey HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
SectionEnd
(the reg-part in one line of course)
greetz
Jochen
Logged In: YES
user_id=584402
You still need SetShellVarContext all. Add it back and it
should work.
Logged In: YES
user_id=1230708
Unfortunately it didn't. I placed it on top and in another
try between the Uninstaller-Code I submitted before you posting
- witout any success.
Logged In: YES
user_id=584402
Try replacing $TEMP with $DESKTOP. Maybe not all
CreateShortcut commands make it work. If you still can't get
it to work, try creating a thread in the forum with a link
to this ticket. You'll probably get faster responses.
Logged In: YES
user_id=584402
Finally fixed this using a call to SHGetFileInfo which does
the same trick as CreateShortcut. Please confirm using
tonight's nightly build:
http://nsis.sf.net/nightly/nsis.zip
It should be updated in around 3 to 4 hours.
The source diff will be available at the following address
at around the same time:
http://cvs.sourceforge.net/viewcvs.py/nsis/NSIS/Source/exehead/Main.c.diff?r1=1.70&r2=1.71
Logged In: YES
user_id=584402
I'm closing this for now because version 2.11, along with
this fix, will be released tomorrow. Please do let me know,
if there are still problems with this.