Archive: Problem with deleting Shortcut


Problem with deleting Shortcut
I have problem when i try to delete shortcut.
Here is source of Creating Shortcuts:


Section "Targovec" Section1

; Set Section properties
SectionIn RO
SetOverwrite on

; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\"
......
CreateShortCut "$DESKTOP\Sklad.lnk" "$INSTDIR\SKLAD.BAT" "" "$INSTDIR\skl.ico" 0
CreateShortCut "$DESKTOP\Archive.lnk" "$INSTDIR\Ar.exe" "" "$INSTDIR\ar.ico" 0
.....
SectionEnd


And here I delete them:

Section Uninstall

;Remove from registry...
.....

; Delete Shortcuts
Delete "$DESKTOP\Archive.lnk"
Delete "$DESKTOP\Sklad.lnk"
.....
SectionEnd


Tested on Win98,Win2000 and WinXP don't work!!!!
Only on Win200 and WinXP: Sklad.lnk is deleted. But not and Archive.lnk
Please help.


I hv also tried. It only deletes Desktop Shortcuts and not the Start Menu ShortCuts. Code :

Delete "$DESKTOP\Application.lnk"
Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Application.lnk"
Delete "$SMPROGRAMS\$STARTMENU_FOLDER\doc.lnk"
Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk"
Delete "$SMPROGRAMS\$STARTMENU_FOLDER"

It only deletes the first ShortCut.
Whats going wrong..?


aleksandrai:
No idea why this is happening. It should work. Perhaps you could attach your script?

Sharad:
Make sure that $STARTMENU_FOLDER is set correctly in your Uninstaller. Just because it is set in the Installer does not mean the value is carried over to the Uninstaller.
You should write it to the registry in the Installer and then read it out again in the Uninstaller.


Links you create targeting to a DOS program or .bat files in some versions of Windows have the link extention changed to .pif. If it is not your case, it is scripting problems.


Yeh the problem is var $STARTMENU_FOLDER is not recognized in uninstaller page. Copying it to another var also doesn't work. How it can be done??


Its done. :up: Thanx for all your help. ;)