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 하기전 처리를 해 줘야 제대로 동작하는 것을 확인.
0 개의 댓글:
댓글 쓰기