본문으로 바로가기
반응형

NSIS Uninstall 시작메뉴 항목들 삭제시 삭제 안되는 부분 처리. 비스타, 윈도우 7 처리

OutFile vista.exe
Name Vista
 
RequestExecutionLevel user
 
Section
  CreateDirectory "$SMPROGRAMS\Vista Test"
  CreateShortcut  "$SMPROGRAMS\Vista Test\hello.lnk" $WINDIR\notepad.exe
  WriteUninstaller $EXEDIR\uninst.exe
SectionEnd
 
Section uninstall
  Delete "$SMPROGRAMS\Vista Test\hello.lnk"
  RMDir "$SMPROGRAMS\Vista Test"
SectionEnd


OutFile vista.exe
Name Vista
 
RequestExecutionLevel admin #NOTE: You still need to check user rights with UserInfo!
 
Function .onInit
#TODO: call UserInfo plugin to make sure user is admin
FunctionEnd
 
Section
  SetShellVarContext all
  CreateDirectory "$SMPROGRAMS\Vista Test"
  CreateShortcut  "$SMPROGRAMS\Vista Test\hello.lnk" $WINDIR\notepad.exe
  WriteUninstaller $EXEDIR\uninst.exe
SectionEnd
 
Section uninstall
  SetShellVarContext all
  Delete "$SMPROGRAMS\Vista Test\hello.lnk"
  RMDir "$SMPROGRAMS\Vista Test"
SectionEnd

SetShellVarContext all < - 처리를 해 주면 된다.

Section
uninstall 에만 넣어 주면 될까 했는데..
CreateShortcut  하기전 처리를 해 줘야 제대로 동작하는 것을 확인.


반응형