I created an window application for which I need to create setup.For creating setup i am using NSIS. I had written script to create setup file which creates shortcut on Desktop and Star Menu now i need to embed an icon to the shortcut.Code is as follows:
Function "CREATE"
createShortCut "$SMPROGRAMS\lnkname.lnk" "$DESKTOP\Application.exe" "ADC" "$DESKTOP\icon.ico" 0
createShortCut "$DESKTOP\lnkname.lnk" "$DESKTOP\ApplicationMDMO\ApplicationMDMO\bin\debug\Application.exe" "ADC" "$DESKTOP\icon.ico" 0
FunctionEnd
Now I created an uninstaller to this installer.In this uninstaller I am deleting the shortcut file and the application file which are installed by installer.
Function "Uninstall"
Delete "$INSTDIR\*.*"
Delete "$DESKTOP\lnkname.lnk"
Delete "$SMPROGRAMS\lnkname.lnk"
FunctionEnd
Problem:
When I am trying to delete the shortcuts which are at desktop and all programs the all program short cut doesn't get deleted unless I add this code.
RequestExecutionLevel admin //at the beginning SetShellVarContext all // at the sectionBut when I add these to lines the icon disappears
When I am excluding the code written in the above code the shortcut at "all Programs " is not purged.