nsis uninstaller doesn't remove links
Asked Answered
F

1

9

I have this issue: in the installer sections I have this;

Section "Start Menu Shortcuts"
    SetShellVarContext current
    CreateDirectory "$SMPROGRAMS\myProgram"
    CreateShortCut "$SMPROGRAMS\myProgram\myProgram.lnk" "$INSTDIR\myProgram.exe" 
    CreateShortCut "$SMPROGRAMS\myProgram\Uninstall myProgram.lnk" "$INSTDIR\myProgram-Uninstall.exe"
SectionEnd

Section "Desktop Shortcut"
    SetShellVarContext current
    CreateShortCut "$DESKTOP\myProgram.lnk" "$INSTDIR\myProgram.exe"
SectionEnd

and it works fine, I have the icon on the desktop and the icon plus the uninstall icon on the start\programs... tree

the uninstaller section is like this:

SetShellVarContext current
Delete "$DESKTOP\myProgram.lnk"
Delete "$SMPROGRAMS\myProgram\myProgram.lnk"
Delete "$SMPROGRAMS\myProgram\Uninstall myProgram.lnk"
RMDir "$SMPROGRAMS\myProgram"

and the desktop link was deleted, but the other folder with the links not.. any ideas?

the folder where is stored is this (i'm on win 7 64 bits):

C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
Flyte answered 25/2, 2013 at 15:1 Comment(0)
C
8

Do you have RequestExecutionLevel in your script? Without it Windows might do some compatibility hacks with your shortcuts.

If that does not help, try Process Monitor, it might be able to shed some light on the issue...

Conglomerate answered 25/2, 2013 at 15:23 Comment(3)
thankyou! i've added the RequestExecutionLevel admin and now works... also that if my currentuser is administrator.. thanksFlyte
I don't know why "RequestExecutionLevel admin" doesn't work for me, but "SetShellVarContext all" does...Leukemia
@Leukemia It should prevent the compatibility shim from kicking in but will not remove the compatibility shortcuts that might already exist...Conglomerate

© 2022 - 2024 — McMap. All rights reserved.