프로그램 추가/제거 프로그램 목록에서 프로그램을 추가하여 제거 할 수 있습니까?어떻게 프로그램을 Windows에 추가/제거합니까? 프로그램 목록 추가/제거
9
A
답변
11
설치 제거 등록이 레지스트리에 당신이 설치하는 모든 사용자 또는 단일 사용자에 대한 프로그램을 설치하는 경우가에 따라 저장해야 레지스트리에 저장됩니다 (IE 사용자 RequestExecutionLevel 설정) :
- 사용자 = HKCU
- 관리 = HKLM
- = SHCTX가 (이 의미 당신이 사용해야 가장 높은 SetShellVarC ontext를 올바르게 입력하고 제거 프로그램에서 올바르게 복원하십시오.)
DisplayName과 UninstallString의 두 가지 값만 있습니다.
!define REGUNINSTKEY "MyApplication" ;Using a GUID here is not a bad idea
!define REGHKEY HKLM ;Assuming RequestExecutionLevel admin AKA all user/machine install
!define REGPATH_WINUNINST "Software\Microsoft\Windows\CurrentVersion\Uninstall"
Section
WriteRegStr ${REGHKEY} "${REGPATH_WINUNINST}\${REGUNINSTKEY}" "DisplayName" "My application"
WriteRegStr ${REGHKEY} "${REGPATH_WINUNINST}\${REGUNINSTKEY}" "UninstallString" '"$INSTDIR\uninstaller.exe"'
SectionEnd
설정할 수있는 여러 옵션 값이 있으며, MSDN 정말 문서화 된 값의 목록 만 NSIS Wiki has a decent list 및 this page있는 더 많은 목록을 제공하지 않습니다 ...
3
사용 예제 :
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"DisplayName" "<Name>" ;The Name shown in the dialog
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"UninstallString" "$INSTDIR\<Path to uninstaller>"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"InstallLocation" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"Publisher" "<Your Name>"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"HelpLink" "<URL>"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"DisplayVersion" "<Version>"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"NoModify" 1 ; The installers does not offer a possibility to modify the installation
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"NoRepair" 1 ; The installers does not offer a possibility to repair the installation
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"ParentDisplayName" "<Parent>" ;
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\<Name>" \
"ParentKeyName" "<ParentKey>" ; The last two reg keys allow the mod to be shown as an update to another software. Leave them out if you don't like this behaviour
N.B. 64 비트 시스템에 32 비트 설치를위한 별도의 위치가 있습니다. https://superuser.com/a/293896/41494 – icc97
@ icc97 정말 다릅니다. 32 비트 설치 프로그램은 64 비트 Windows에서 레지스트리의 32 비트 부분에 기록합니다. Regedit에서 키를 보려면 예를 들어, 64 비트 Regedit.exe를 실행하는 경우 WoW64 키를 봐야합니다. – Anders