Add prototype of user installation mode
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 3 May 2017 15:08:41 +0000 (17:08 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 3 May 2017 15:08:41 +0000 (17:08 +0200)
--
This requires a newer GnuPG Version that supports it and GpgOL /
GpgEX and file extensions don't work yet. But installation works
start menu works and in general it's usable (if you have a GnuPG
installer supporting it)

Task: T2971

13 files changed:
src/g4wihelp.c
src/gpg4win-src.nsi
src/gpg4win.nsi
src/inst-gpa.nsi
src/inst-gpg4win.nsi
src/inst-kleopatra.nsi
src/installer-finish.nsi
src/installer.nsi
src/uninst-claws-mail-cmds.nsi
src/uninst-gnupg-w32.nsi
src/uninst-gpa.nsi
src/uninst-gpg4win.nsi
src/uninst-kleopatra.nsi

index 12b859a..ddb7eb5 100644 (file)
@@ -1,7 +1,7 @@
 /* g4wihelp.c - NSIS Helper DLL used with gpg4win. -*- coding: latin-1; -*-
  * Copyright (C) 2005 g10 Code GmbH
  * Copyright (C) 2001 Justin Frankel
- * Copyright (C) 2016 Intevation GmbH
+ * Copyright (C) 2016, 2017 Intevation GmbH
  *
  * This software is provided 'as-is', without any express or implied
  * warranty. In no event will the authors be held liable for any
index e614e7c..45c9ea9 100644 (file)
@@ -60,7 +60,7 @@
 
 # We use Memento to remember past installation choices.
 !include Memento.nsh
-!define MEMENTO_REGISTRY_ROOT HKLM
+!define MEMENTO_REGISTRY_ROOT SHCTX
 !define MEMENTO_REGISTRY_KEY \
   Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRETTY_PACKAGE_SHORT}
 # We need to know wether we are installing to 64 bit.
index 2e22591..065a924 100644 (file)
 # necessary if you want to handle DLLs properly.
 # !define REQUIRE_W32_NSIS
 
-
-# Define if in debug mode.
-!ifdef GPG4WIN_DEBUG
-!define DEBUG
-!endif
-
 # Most of the included software has implicit requirements for at least
 # NT4 if not even higher.  To be sure require at least Windows XP.
-# Fixme: Enable if we have makensis 2.50
-#TargetMinimalOS 5.1
-
-# Admin privileges are required for installation
-RequestExecutionLevel admin
+# TargetMinimalOS 5.1
+
+# We support user mode installation but prefer system wide
+!define MULTIUSER_EXECUTIONLEVEL Highest
+!define MULTIUSER_MUI
+!define MULTIUSER_INSTALLMODE_COMMANDLINE
+!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "Software\${PRETTY_PACKAGE_SHORT}"
+!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME ""
+!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "Software\${PRETTY_PACKAGE_SHORT}"
+!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "Install Directory"
+!define MULTIUSER_INSTALLMODE_INSTDIR "${PRETTY_PACKAGE_SHORT}"
+!include "MultiUser.nsh"
+!ifdef DEBUG
+!undef DEBUG
+!endif
 
 # The installation directory.
 !define ipdir "playground/install/pkgs"
 !define exipdir "playground/install-ex/pkgs"
 !define bpdir "playground/build"
 
-# Select the best compression algorithm available.  The dictionary
-# size is the default (8 MB).
-!ifndef DISABLE_LZMA
-!ifndef SOURCES
-SetCompressor /SOLID lzma
-# SetCompressorDictSize 8
-!endif
-!endif
-
 !ifndef GPG4WIN_VANILLA
 # Claws is a bit special because we installed
 # it for some time and now remove the old
@@ -182,7 +177,7 @@ SetCompressor /SOLID lzma
 
 # We use Memento to remember past installation choices.
 !include Memento.nsh
-!define MEMENTO_REGISTRY_ROOT HKLM
+!define MEMENTO_REGISTRY_ROOT SHCTX
 !define MEMENTO_REGISTRY_KEY \
   Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRETTY_PACKAGE_SHORT}
 # We need to know wether we are installing to 64 bit.
index 58a147c..25ffa29 100644 (file)
@@ -72,9 +72,9 @@
 
   no_config_gpa_files:
 
-  WriteRegStr HKLM "Software\Gpg4win\gpa\Capabilities" "ApplicationDescription" "$(DESC_SEC_gpa)"
-  WriteRegStr HKLM "Software\Gpg4win\gpa\Capabilities" "ApplicationIcon" "$INSTDIR\bin\gpa.exe,0"
-  WriteRegStr HKLM "Software\Gpg4win\gpa\Capabilities" "ApplicationName" "$(DESC_SEC_gpa)"
+  WriteRegStr SHCTX "Software\Gpg4win\gpa\Capabilities" "ApplicationDescription" "$(DESC_SEC_gpa)"
+  WriteRegStr SHCTX "Software\Gpg4win\gpa\Capabilities" "ApplicationIcon" "$INSTDIR\bin\gpa.exe,0"
+  WriteRegStr SHCTX "Software\Gpg4win\gpa\Capabilities" "ApplicationName" "$(DESC_SEC_gpa)"
 
 !endif
 ${MementoSectionEnd}
index 0e4ea74..9d20616 100644 (file)
@@ -39,13 +39,13 @@ Section "-gpg4win" SEC_gpg4win
 
 # Uninstall an old version if found.
   ClearErrors
-  ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPG4Win" "DisplayVersion"
+  ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPG4Win" "DisplayVersion"
   IfErrors skip_uninst 0
   StrCmp $0 "" skip_uninst
   DetailPrint  "$(T_UninstallingOldVersion)$0"
-  ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPG4Win" "UninstallString"
+  ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPG4Win" "UninstallString"
   IfErrors skip_uninst 0
-  ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPG4Win" "InstallLocation"
+  ReadRegStr $1 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPG4Win" "InstallLocation"
   IfErrors skip_uninst 0
 
   ExecWait '$0 /S _?=$1'
@@ -79,14 +79,14 @@ skip_uninst:
   DetailPrint "VERSION closed"
 
   # Register the install directory for Gpg4win suite.
-  WriteRegStr HKLM "Software\${PRETTY_PACKAGE_SHORT}" "Install Directory" $INSTDIR
+  WriteRegStr SHCTX "Software\${PRETTY_PACKAGE_SHORT}" "Install Directory" $INSTDIR
   DetailPrint "Saved install directory in the registry"
 
   # We used to determine the language using a Registry entry.
   # Although we don't want to delete the user's Lang Registry Setting
   # because he might have have selected a different language than his
   # default.  We delete the global Lang of the installation.
-  DeleteRegValue HKLM "Software\GNU\GnuPG" "Lang"
+  DeleteRegValue SHCTX "Software\GNU\GnuPG" "Lang"
   DetailPrint "Deleted obsolete Lang entry"
 
   # This old key is required for GPGee.  Please do not use in new
@@ -94,10 +94,10 @@ skip_uninst:
   # Note: We don't use it anymore so that gpgme decides what gpg to use
   #       For the new gpg4win we actually use gpg2.exe.
   #       To cope with old installations we actually remove this value.
-  #       However we can only remove the HKLM version not those set by
+  #       However we can only remove the SHCTX version not those set by
   #       the user under HKCU.
-  #WriteRegStr HKLM "Software\GNU\GnuPG" "gpgProgram" "$INSTDIR\gpg.exe"
-  DeleteRegValue HKLM "Software\GNU\GnuPG" "gpgProgram"
+  #WriteRegStr SHCTX "Software\GNU\GnuPG" "gpgProgram" "$INSTDIR\gpg.exe"
+  DeleteRegValue SHCTX "Software\GNU\GnuPG" "gpgProgram"
   DetailPrint "Deleted obsolete gpgProgram value"
 
   # Install gpg4win included tools
index 9f00743..e418244 100644 (file)
@@ -263,9 +263,9 @@ ${MementoSection} "Kleopatra" SEC_kleopatra
   FileClose $1
   pop $1
 
-  WriteRegStr HKLM "Software\Gpg4win\kleopatra\Capabilities" "ApplicationDescription" "$(DESC_SEC_kleopatra)"
-  WriteRegStr HKLM "Software\Gpg4win\kleopatra\Capabilities" "ApplicationIcon" "$INSTDIR\bin\kleopatra.exe,0"
-  WriteRegStr HKLM "Software\Gpg4win\kleopatra\Capabilities" "ApplicationName" "Kleopatra"
+  WriteRegStr SHCTX "Software\Gpg4win\kleopatra\Capabilities" "ApplicationDescription" "$(DESC_SEC_kleopatra)"
+  WriteRegStr SHCTX "Software\Gpg4win\kleopatra\Capabilities" "ApplicationIcon" "$INSTDIR\bin\kleopatra.exe,0"
+  WriteRegStr SHCTX "Software\Gpg4win\kleopatra\Capabilities" "ApplicationName" "Kleopatra"
 
 !endif
 ${MementoSectionEnd}
index 36bf116..302292a 100644 (file)
@@ -22,108 +22,108 @@ Var MYTMP
 Function SetupExtRegKeys
   Pop $0
   # .gpg
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.GPG" "" "$(T_File_Type_gpg_Name)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.GPG" "FriendlyTypeName" "$(T_File_Type_gpg_Name)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.GPG" "PercievedType" "Document"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.GPG" "InfoTip" "$(T_File_Type_info_tip)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.GPG\CurVer" "" "${VERSION}"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.GPG\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.GPG\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.GPG" "" "$(T_File_Type_gpg_Name)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.GPG" "FriendlyTypeName" "$(T_File_Type_gpg_Name)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.GPG" "PercievedType" "Document"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.GPG" "InfoTip" "$(T_File_Type_info_tip)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.GPG\CurVer" "" "${VERSION}"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.GPG\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.GPG\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
 
-  WriteRegBin HKLM "Software\Classes\.gpg\OpenWithProgIDs" "gpg4win.AssocFile.$0.GPG" 0
+  WriteRegBin SHCTX "Software\Classes\.gpg\OpenWithProgIDs" "gpg4win.AssocFile.$0.GPG" 0
 
   # .asc
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.ASC" "" "$(T_File_Type_asc_Name)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.ASC" "FriendlyTypeName" "$(T_File_Type_asc_Name)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.ASC" "PercievedType" "Document"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.ASC" "InfoTip" "$(T_File_Type_info_tip)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.ASC\CurVer" "" "${VERSION}"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.ASC\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.ASC\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
-  WriteRegBin HKLM "Software\Classes\.asc\OpenWithProgIDs" "gpg4win.AssocFile.$0.ASC" 0
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.ASC" "" "$(T_File_Type_asc_Name)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.ASC" "FriendlyTypeName" "$(T_File_Type_asc_Name)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.ASC" "PercievedType" "Document"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.ASC" "InfoTip" "$(T_File_Type_info_tip)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.ASC\CurVer" "" "${VERSION}"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.ASC\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.ASC\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
+  WriteRegBin SHCTX "Software\Classes\.asc\OpenWithProgIDs" "gpg4win.AssocFile.$0.ASC" 0
 
   # .pgp
-  WriteRegBin HKLM "Software\Classes\.pgp\OpenWithProgIDs" "gpg4win.AssocFile.$0.GPG" 0
+  WriteRegBin SHCTX "Software\Classes\.pgp\OpenWithProgIDs" "gpg4win.AssocFile.$0.GPG" 0
 
   # .sig
-  WriteRegExpandStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPSIG\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPSIG" "FriendlyTypeName" "$(T_File_Type_sig_Name)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPSIG" "PercievedType" "Document"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPSIG" "InfoTip" "$(T_File_Type_sig_info_tip)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPSIG\CurVer" "" "${VERSION}"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPSIG\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPSIG\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
+  WriteRegExpandStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPSIG\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPSIG" "FriendlyTypeName" "$(T_File_Type_sig_Name)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPSIG" "PercievedType" "Document"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPSIG" "InfoTip" "$(T_File_Type_sig_info_tip)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPSIG\CurVer" "" "${VERSION}"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPSIG\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPSIG\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
 
-  WriteRegBin HKLM "Software\Classes\.sig\OpenWithProgIDs" "gpg4win.AssocFile.$0.PGPSIG" 0
+  WriteRegBin SHCTX "Software\Classes\.sig\OpenWithProgIDs" "gpg4win.AssocFile.$0.PGPSIG" 0
 
   # OpenPGP Key to be used in mime registry
-  WriteRegExpandStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPKEY\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPKEY" "FriendlyTypeName" "$(T_File_Type_pgp_key_Name)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPKEY" "PercievedType" "Document"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPKEY" "InfoTip" "$(T_File_Type_pgp_key_info_tip)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPKEY\CurVer" "" "${VERSION}"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPKEY\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.PGPKEY\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
+  WriteRegExpandStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPKEY\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPKEY" "FriendlyTypeName" "$(T_File_Type_pgp_key_Name)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPKEY" "PercievedType" "Document"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPKEY" "InfoTip" "$(T_File_Type_pgp_key_info_tip)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPKEY\CurVer" "" "${VERSION}"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPKEY\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.PGPKEY\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
 
   # CMS
-  WriteRegExpandStr HKLM "Software\Classes\gpg4win.AssocFile.$0.CMS\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.CMS" "FriendlyTypeName" "$(T_File_Type_pem_Name)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.CMS" "PercievedType" "Document"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.CMS" "InfoTip" "$(T_File_Type_info_tip)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.CMS\CurVer" "" "${VERSION}"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.CMS\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.CMS\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
-#  WriteRegBin HKLM "Software\Classes\gpg4win.AssocFile.$0.CMS" "AllowSilentDefaultTakeOver" 0
-
-  WriteRegBin HKLM "Software\Classes\.p7s\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
-  WriteRegBin HKLM "Software\Classes\.p7m\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
-  WriteRegBin HKLM "Software\Classes\.crl\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
-  WriteRegBin HKLM "Software\Classes\.pem\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
-  WriteRegBin HKLM "Software\Classes\.arl\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
+  WriteRegExpandStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.CMS\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.CMS" "FriendlyTypeName" "$(T_File_Type_pem_Name)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.CMS" "PercievedType" "Document"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.CMS" "InfoTip" "$(T_File_Type_info_tip)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.CMS\CurVer" "" "${VERSION}"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.CMS\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.CMS\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
+#  WriteRegBin SHCTX "Software\Classes\gpg4win.AssocFile.$0.CMS" "AllowSilentDefaultTakeOver" 0
+
+  WriteRegBin SHCTX "Software\Classes\.p7s\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
+  WriteRegBin SHCTX "Software\Classes\.p7m\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
+  WriteRegBin SHCTX "Software\Classes\.crl\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
+  WriteRegBin SHCTX "Software\Classes\.pem\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
+  WriteRegBin SHCTX "Software\Classes\.arl\OpenWithProgIDs" "gpg4win.AssocFile.$0.CMS" 0
 
   # X509 Certificates
-  WriteRegExpandStr HKLM "Software\Classes\gpg4win.AssocFile.$0.X509\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.X509" "FriendlyTypeName" "$(T_File_Type_x509_Name)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.X509" "PercievedType" "Document"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.X509" "InfoTip" "$(T_File_Type_x509_info_tip)"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.X509\CurVer" "" "${VERSION}"
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.X509\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
-  WriteRegStr HKLM "Software\Classes\gpg4win.AssocFile.$0.X509\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
-  WriteRegBin HKLM "Software\Classes\gpg4win.AssocFile.$0.X509" "AllowSilentDefaultTakeOver" 0
+  WriteRegExpandStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.X509\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.X509" "FriendlyTypeName" "$(T_File_Type_x509_Name)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.X509" "PercievedType" "Document"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.X509" "InfoTip" "$(T_File_Type_x509_info_tip)"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.X509\CurVer" "" "${VERSION}"
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.X509\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Classes\gpg4win.AssocFile.$0.X509\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
+  WriteRegBin SHCTX "Software\Classes\gpg4win.AssocFile.$0.X509" "AllowSilentDefaultTakeOver" 0
 
   # Register capabilities
-  WriteRegStr HKLM "Software\RegisteredApplications" "Gpg4win.$0" "SOFTWARE\Gpg4win\$0\Capabilities"
-  WriteRegStr HKLM "Software\Gpg4win\$0" "" "$0"
+  WriteRegStr SHCTX "Software\RegisteredApplications" "Gpg4win.$0" "SOFTWARE\Gpg4win\$0\Capabilities"
+  WriteRegStr SHCTX "Software\Gpg4win\$0" "" "$0"
 
   # File extensions
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".pgp" "gpg4win.AssocFile.$0.GPG"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".asc" "gpg4win.AssocFile.$0.ASC"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".gpg" "gpg4win.AssocFile.$0.GPG"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".cer" "gpg4win.AssocFile.$0.X509"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p10" "gpg4win.AssocFile.$0.X509"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p12" "gpg4win.AssocFile.$0.X509"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p7c" "gpg4win.AssocFile.$0.X509"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".pfx" "gpg4win.AssocFile.$0.X509"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".crt" "gpg4win.AssocFile.$0.X509"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".der" "gpg4win.AssocFile.$0.X509"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".sig" "gpg4win.AssocFile.$0.PGPSIG"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".arl" "gpg4win.AssocFile.$0.CMS"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".crl" "gpg4win.AssocFile.$0.CMS"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p7m" "gpg4win.AssocFile.$0.CMS"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p7s" "gpg4win.AssocFile.$0.CMS"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\FileAssociations" ".pem" "gpg4win.AssocFile.$0.CMS"
-
-  WriteRegExpandStr HKLM "Software\Gpg4win\$0\Capabilities\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".pgp" "gpg4win.AssocFile.$0.GPG"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".asc" "gpg4win.AssocFile.$0.ASC"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".gpg" "gpg4win.AssocFile.$0.GPG"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".cer" "gpg4win.AssocFile.$0.X509"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p10" "gpg4win.AssocFile.$0.X509"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p12" "gpg4win.AssocFile.$0.X509"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p7c" "gpg4win.AssocFile.$0.X509"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".pfx" "gpg4win.AssocFile.$0.X509"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".crt" "gpg4win.AssocFile.$0.X509"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".der" "gpg4win.AssocFile.$0.X509"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".sig" "gpg4win.AssocFile.$0.PGPSIG"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".arl" "gpg4win.AssocFile.$0.CMS"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".crl" "gpg4win.AssocFile.$0.CMS"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p7m" "gpg4win.AssocFile.$0.CMS"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".p7s" "gpg4win.AssocFile.$0.CMS"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\FileAssociations" ".pem" "gpg4win.AssocFile.$0.CMS"
+
+  WriteRegExpandStr SHCTX "Software\Gpg4win\$0\Capabilities\shell\open\command" "" "$\"$INSTDIR\bin\$0.exe$\" $\"%1$\""
 
   # Mime extensions For PGP this is probably pretty useless
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pgp" "gpg4win.AssocFile.$0.GPG"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pgp-keys" "gpg4win.AssocFile.$0.PGPKEY"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pgp-encrypted" "gpg4win.AssocFile.$0.GPG"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pgp-signature" "gpg4win.AssocFile.$0.GPG"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pkcs7-mime" "gpg4win.AssocFile.$0.CMS"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pkix-cert" "gpg4win.AssocFile.$0.CMS"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/x-x509-ca-cert" "gpg4win.AssocFile.$0.X509"
-  WriteRegStr HKLM "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/x-pkcs12" "gpg4win.AssocFile.$0.X509"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pgp" "gpg4win.AssocFile.$0.GPG"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pgp-keys" "gpg4win.AssocFile.$0.PGPKEY"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pgp-encrypted" "gpg4win.AssocFile.$0.GPG"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pgp-signature" "gpg4win.AssocFile.$0.GPG"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pkcs7-mime" "gpg4win.AssocFile.$0.CMS"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/pkix-cert" "gpg4win.AssocFile.$0.CMS"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/x-x509-ca-cert" "gpg4win.AssocFile.$0.X509"
+  WriteRegStr SHCTX "Software\Gpg4win\$0\Capabilities\MimeAssociations" "application/x-pkcs12" "gpg4win.AssocFile.$0.X509"
 
 FunctionEnd
 
@@ -201,20 +201,20 @@ Section
   # the version number.  Some tools do that, other don't.  I don't
   # like it but others want me to do that.  -wk
   StrCpy $MYTMP "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRETTY_PACKAGE_SHORT}"
-  WriteRegExpandStr HKLM $MYTMP "UninstallString" '"$INSTDIR\${PACKAGE}-uninstall.exe"'
-  WriteRegExpandStr HKLM $MYTMP "InstallLocation" "$INSTDIR"
-  WriteRegStr       HKLM $MYTMP "DisplayName"     "${PRETTY_PACKAGE} (${VERSION})"
-  WriteRegStr       HKLM $MYTMP "DisplayIcon"     "$INSTDIR\bin\kleopatra.exe,0"
-  WriteRegStr       HKLM $MYTMP "DisplayVersion"  "${VERSION}"
-  WriteRegStr       HKLM $MYTMP "Publisher"       "The Gpg4win Project"
-  WriteRegStr       HKLM $MYTMP "URLInfoAbout"    "http://www.gpg4win.org/"
-  WriteRegDWORD     HKLM $MYTMP "NoModify"        "1"
-  WriteRegDWORD     HKLM $MYTMP "NoRepair"        "1"
-
-  WriteRegStr HKLM "Software\Classes\MIME\Database\Content Type\application/pgp" "Extension" ".gpg"
-  WriteRegStr HKLM "Software\Classes\MIME\Database\Content Type\application/pgp-signature" "Extension" ".sig"
-  WriteRegStr HKLM "Software\Classes\MIME\Database\Content Type\application/pgp-encrypted" "Extension" ".gpg"
-  WriteRegStr HKLM "Software\Classes\MIME\Database\Content Type\application/pgp-keys" "Extension" ".gpg"
+  WriteRegExpandStr SHCTX $MYTMP "UninstallString" '"$INSTDIR\${PACKAGE}-uninstall.exe"'
+  WriteRegExpandStr SHCTX $MYTMP "InstallLocation" "$INSTDIR"
+  WriteRegStr       SHCTX $MYTMP "DisplayName"     "${PRETTY_PACKAGE} (${VERSION})"
+  WriteRegStr       SHCTX $MYTMP "DisplayIcon"     "$INSTDIR\bin\kleopatra.exe,0"
+  WriteRegStr       SHCTX $MYTMP "DisplayVersion"  "${VERSION}"
+  WriteRegStr       SHCTX $MYTMP "Publisher"       "The Gpg4win Project"
+  WriteRegStr       SHCTX $MYTMP "URLInfoAbout"    "http://www.gpg4win.org/"
+  WriteRegDWORD     SHCTX $MYTMP "NoModify"        "1"
+  WriteRegDWORD     SHCTX $MYTMP "NoRepair"        "1"
+
+  WriteRegStr SHCTX "Software\Classes\MIME\Database\Content Type\application/pgp" "Extension" ".gpg"
+  WriteRegStr SHCTX "Software\Classes\MIME\Database\Content Type\application/pgp-signature" "Extension" ".sig"
+  WriteRegStr SHCTX "Software\Classes\MIME\Database\Content Type\application/pgp-encrypted" "Extension" ".gpg"
+  WriteRegStr SHCTX "Software\Classes\MIME\Database\Content Type\application/pgp-keys" "Extension" ".gpg"
 
   call SetupExtensions
 SectionEnd
@@ -255,17 +255,17 @@ Section Uninstall
   RMDir /REBOOTOK "$INSTDIR"
 
   # Clean the registry.
-  DeleteRegValue HKLM "Software\${PRETTY_PACKAGE_SHORT}" \
+  DeleteRegValue SHCTX "Software\${PRETTY_PACKAGE_SHORT}" \
         "Install Directory"
-  DeleteRegKey /ifempty HKLM "Software\${PRETTY_PACKAGE_SHORT}"
+  DeleteRegKey /ifempty SHCTX "Software\${PRETTY_PACKAGE_SHORT}"
 
   # Remove Windows Add/Remove Programs support.
-  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRETTY_PACKAGE_SHORT}"
+  DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRETTY_PACKAGE_SHORT}"
 
-  DeleteRegKey HKLM "Software\Classes\MIME\Database\Content Type\application/pgp"
-  DeleteRegKey HKLM "Software\Classes\MIME\Database\Content Type\application/pgp-signature"
-  DeleteRegKey HKLM "Software\Classes\MIME\Database\Content Type\application/pgp-encrypted"
-  DeleteRegKey HKLM "Software\Classes\MIME\Database\Content Type\application/pgp-keys"
+  DeleteRegKey SHCTX "Software\Classes\MIME\Database\Content Type\application/pgp"
+  DeleteRegKey SHCTX "Software\Classes\MIME\Database\Content Type\application/pgp-signature"
+  DeleteRegKey SHCTX "Software\Classes\MIME\Database\Content Type\application/pgp-encrypted"
+  DeleteRegKey SHCTX "Software\Classes\MIME\Database\Content Type\application/pgp-keys"
 
 
 SectionEnd
index 90cfbc3..c64ccf6 100644 (file)
 !include "WinMessages.nsh"
 
 # We use the modern UI 2.
-!ifdef DEBUG
-!include "MUI2.nsh"
-!else
 !include "MUI2.nsh"
-# MUI2 defines debug
+!ifdef DEBUG
 !undef DEBUG
 !endif
 
@@ -56,11 +53,6 @@ ShowInstDetails nevershow
 !endif
 InstallDir "$PROGRAMFILES\${INSTALL_DIR}"
 
-
-InstallDirRegKey HKLM "Software\${PRETTY_PACKAGE_SHORT}" \
-       "Install Directory"
-
-
 # Add version information to the file properties.
 VIProductVersion "${PROD_VERSION}"
 VIAddVersionKey "ProductName" "${PRETTY_PACKAGE_SHORT} (${VERSION})"
@@ -110,7 +102,7 @@ Var OtherGnuPGDetected
 
 # Remember the installer language
 
-!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
+!define MUI_LANGDLL_REGISTRY_ROOT "SHCTX"
 !define MUI_LANGDLL_REGISTRY_KEY "Software\${PRETTY_PACKAGE_SHORT}"
 !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
 
@@ -323,7 +315,7 @@ FunctionEnd
 Function CheckOtherGnuPGApps
   StrCpy $OtherGnuPGDetected ""
   ClearErrors
-  ReadRegStr $0 HKLM "Software\GNU\GnuPP\Settings" "Path"
+  ReadRegStr $0 SHCTX "Software\GNU\GnuPP\Settings" "Path"
   IfErrors +2 0
     Call PrintGnuPPWarning
 
@@ -332,11 +324,11 @@ Function CheckOtherGnuPGApps
     Call PrintGnuPTWarning
 
   ClearErrors
-  ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Windows Privacy Tools" "DisplayVersion"
+  ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\Windows Privacy Tools" "DisplayVersion"
   IfErrors +2 0
     Call PrintWinPTSFWarning
 
-  ReadRegStr $0 HKLM "Software\GNU\GnuPG" "Install Directory"
+  ReadRegStr $0 SHCTX "Software\GNU\GnuPG" "Install Directory"
   Push $0
   Push "GnuPG-Pack"
   Call StrStr
@@ -389,9 +381,10 @@ Function PrintNonAdminWarning
   UserInfo::GetAccountType
   Pop $1
   StrCmp $1 "Admin" leave +1
-  MessageBox MB_OK "$(T_AdminNeeded)"
+  MessageBox MB_YESNO "$(T_AdminWanted)" IDNO exit
+  goto leave
+exit:
   Quit
-
  leave:
 FunctionEnd
 
@@ -526,8 +519,12 @@ LangString T_BetaWarning ${LANG_ENGLISH} \
     shall not be used in a production environment."
 
 # From Function PrintNonAdminWarning
-LangString T_AdminNeeded ${LANG_ENGLISH} \
-   "Warning: Administrator permissions required for a successful installation"
+LangString T_AdminWanted ${LANG_ENGLISH} \
+    "Warning: It is recommended to install Gpg4win system-wide with \
+        administrator rights. \
+          $\r$\n\
+          $\r$\n\
+    Do you want to continue installing Gpg4win without administrator rights?"
 
 # From Function PrintCloseOtherApps
 LangString T_CloseOtherApps ${LANG_ENGLISH} \
@@ -626,8 +623,6 @@ Function ${un}StrStr
    Exch $R1
 FunctionEnd
 !macroend
-!insertmacro StrStr ""
-!insertmacro StrStr "un."
 
 
 # TrimNewlines  - taken from the NSIS reference
@@ -670,7 +665,19 @@ Function .onInit
   Delete $TEMP\gpgspltmp.bmp
   # Note that we delete gpgspltmp.wav in .onInst{Failed,Success}
 !endif
-
+  Var /GLOBAL changed_dir
+  # Check if the install directory was modified on the command line
+  StrCmp "$INSTDIR" "$PROGRAMFILES\${INSTALL_DIR}" unmodified 0
+  # It is modified. Save that value.
+  StrCpy $changed_dir "$INSTDIR"
+
+  # MULITUSER_INIT overwrites directory setting from command line
+  !insertmacro MULTIUSER_INIT
+  StrCpy $INSTDIR "$changed_dir"
+  goto initDone
+unmodified:
+  !insertmacro MULTIUSER_INIT
+initDone:
   # Enable this to force a language selection dialog on every run (the
   # preferred language is the default).  Otherwise, the preferred
   # language is stored in the registry, and the installer does not ask
@@ -688,6 +695,7 @@ FunctionEnd
 
 
 Function un.onInit
+  !insertmacro MULTIUSER_UNINIT
   # Remove the language preference.
   !insertmacro MUI_UNGETLANGUAGE
 FunctionEnd
index 642cc34..54f9380 100644 (file)
@@ -75,8 +75,8 @@ Delete "$INSTDIR\share\locale\en_GB\LC_MESSAGES\claws-mail.mo"
 
 RMDir "$INSTDIR\share\claws-mail"
 
-DeleteRegKey HKLM "SOFTWARE\Clients\Mail\Claws Mail"
-DeleteRegKey HKLM "SOFTWARE\Classes\Claws-Mail.Url.mailto"
+DeleteRegKey SHCTX "SOFTWARE\Clients\Mail\Claws Mail"
+DeleteRegKey SHCTX "SOFTWARE\Classes\Claws-Mail.Url.mailto"
 
 ; libetpan
 Delete "$INSTDIR\bin\libetpan-13.dll"
index a74de4b..b17706a 100644 (file)
@@ -30,7 +30,7 @@ Section  "un.gnupg_w32"
   Call un.SourceDelete
 !else
   ClearErrors
-  ReadRegStr $0 HKLM "Software\GnuPG" "Install Directory"
+  ReadRegStr $0 SHCTX "Software\GnuPG" "Install Directory"
   IfErrors gnupg_w32_not_installed 0
   # It is possible that someone uninstalled gnupg without uninstalling
   # gpg4win
index f34fa3b..0eac5f8 100644 (file)
@@ -44,32 +44,32 @@ Section "-un.gpa"
   Delete "$INSTDIR\share\gpa\gpa.png"
   RMDir "$INSTDIR\share\gpa"
 
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.gpa.GPG"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.gpa.ASC"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.gpa.CMS"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.gpa.X509"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.gpa.PGPSIG"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.gpa.PGPKEY"
-  DeleteRegKey HKLM "Software\Gpg4win\gpa"
-  DeleteRegValue HKLM "Software\RegisteredApplications" "Gpg4win.gpa"
-  DeleteRegValue HKLM "Software\Classes\.gpg" "gpg4win.AssocFile.gpa.GPG"
-  DeleteRegValue HKLM "Software\Classes\.asc" "gpg4win.AssocFile.gpa.ASC"
-  DeleteRegValue HKLM "Software\Classes\.pgp" "gpg4win.AssocFile.gpa.PGP"
-  DeleteRegValue HKLM "Software\Classes\.pem" "gpg4win.AssocFile.gpa.CMS"
-  DeleteRegValue HKLM "Software\Classes\.p7s" "gpg4win.AssocFile.gpa.CMS"
-  DeleteRegValue HKLM "Software\Classes\.p7m" "gpg4win.AssocFile.gpa.CMS"
-  DeleteRegValue HKLM "Software\Classes\.arl" "gpg4win.AssocFile.gpa.CMS"
-  DeleteRegValue HKLM "Software\Classes\.crl" "gpg4win.AssocFile.gpa.CMS"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.gpa.GPG"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.gpa.ASC"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.gpa.CMS"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.gpa.X509"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.gpa.PGPSIG"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.gpa.PGPKEY"
+  DeleteRegKey SHCTX "Software\Gpg4win\gpa"
+  DeleteRegValue SHCTX "Software\RegisteredApplications" "Gpg4win.gpa"
+  DeleteRegValue SHCTX "Software\Classes\.gpg" "gpg4win.AssocFile.gpa.GPG"
+  DeleteRegValue SHCTX "Software\Classes\.asc" "gpg4win.AssocFile.gpa.ASC"
+  DeleteRegValue SHCTX "Software\Classes\.pgp" "gpg4win.AssocFile.gpa.PGP"
+  DeleteRegValue SHCTX "Software\Classes\.pem" "gpg4win.AssocFile.gpa.CMS"
+  DeleteRegValue SHCTX "Software\Classes\.p7s" "gpg4win.AssocFile.gpa.CMS"
+  DeleteRegValue SHCTX "Software\Classes\.p7m" "gpg4win.AssocFile.gpa.CMS"
+  DeleteRegValue SHCTX "Software\Classes\.arl" "gpg4win.AssocFile.gpa.CMS"
+  DeleteRegValue SHCTX "Software\Classes\.crl" "gpg4win.AssocFile.gpa.CMS"
 
-  DeleteRegKey /ifempty HKLM "Software\Classes\.gpg"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.asc"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.pgp"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.sig"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.pem"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.p7m"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.p7s"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.crl"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.arl"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.gpg"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.asc"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.pgp"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.sig"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.pem"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.p7m"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.p7s"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.crl"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.arl"
 
 !endif
 SectionEnd
index 80e77d6..51ce89f 100644 (file)
@@ -24,7 +24,7 @@ Section "-un.gpg4win"
   Delete "gpg4win-${VERSION}.tar.bz2"
 !else
 
-  DeleteRegValue HKLM "Software\GNU\GnuPG" "Install Directory"
+  DeleteRegValue SHCTX "Software\GNU\GnuPG" "Install Directory"
 
   # Delete gpg4win included tools
   Delete "$INSTDIR\bin\sha1sum.exe"
index abebacb..3111db1 100644 (file)
@@ -211,32 +211,32 @@ Section "-un.kleopatra"
 
   DetailPrint "Unregistering file extensions"
 
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.kleopatra.GPG"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.kleopatra.ASC"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.kleopatra.CMS"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.kleopatra.X509"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.kleopatra.PGPSIG"
-  DeleteRegKey HKLM "Software\Classes\gpg4win.AssocFile.kleopatra.PGPKEY"
-  DeleteRegKey HKLM "Software\Gpg4win\kleopatra"
-  DeleteRegValue HKLM "Software\RegisteredApplications" "Gpg4win.kleopatra"
-  DeleteRegValue HKLM "Software\Classes\.gpg" "gpg4win.AssocFile.kleopatra.GPG"
-  DeleteRegValue HKLM "Software\Classes\.asc" "gpg4win.AssocFile.kleopatra.ASC"
-  DeleteRegValue HKLM "Software\Classes\.pgp" "gpg4win.AssocFile.kleopatra.PGP"
-  DeleteRegValue HKLM "Software\Classes\.pem" "gpg4win.AssocFile.kleopatra.CMS"
-  DeleteRegValue HKLM "Software\Classes\.p7s" "gpg4win.AssocFile.kleopatra.CMS"
-  DeleteRegValue HKLM "Software\Classes\.p7m" "gpg4win.AssocFile.kleopatra.CMS"
-  DeleteRegValue HKLM "Software\Classes\.arl" "gpg4win.AssocFile.kleopatra.CMS"
-  DeleteRegValue HKLM "Software\Classes\.crl" "gpg4win.AssocFile.kleopatra.CMS"
-  DeleteRegValue HKLM "Software\Classes\.crl" "gpg4win.AssocFile.kleopatra.CMS"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.kleopatra.GPG"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.kleopatra.ASC"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.kleopatra.CMS"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.kleopatra.X509"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.kleopatra.PGPSIG"
+  DeleteRegKey SHCTX "Software\Classes\gpg4win.AssocFile.kleopatra.PGPKEY"
+  DeleteRegKey SHCTX "Software\Gpg4win\kleopatra"
+  DeleteRegValue SHCTX "Software\RegisteredApplications" "Gpg4win.kleopatra"
+  DeleteRegValue SHCTX "Software\Classes\.gpg" "gpg4win.AssocFile.kleopatra.GPG"
+  DeleteRegValue SHCTX "Software\Classes\.asc" "gpg4win.AssocFile.kleopatra.ASC"
+  DeleteRegValue SHCTX "Software\Classes\.pgp" "gpg4win.AssocFile.kleopatra.PGP"
+  DeleteRegValue SHCTX "Software\Classes\.pem" "gpg4win.AssocFile.kleopatra.CMS"
+  DeleteRegValue SHCTX "Software\Classes\.p7s" "gpg4win.AssocFile.kleopatra.CMS"
+  DeleteRegValue SHCTX "Software\Classes\.p7m" "gpg4win.AssocFile.kleopatra.CMS"
+  DeleteRegValue SHCTX "Software\Classes\.arl" "gpg4win.AssocFile.kleopatra.CMS"
+  DeleteRegValue SHCTX "Software\Classes\.crl" "gpg4win.AssocFile.kleopatra.CMS"
+  DeleteRegValue SHCTX "Software\Classes\.crl" "gpg4win.AssocFile.kleopatra.CMS"
 
-  DeleteRegKey /ifempty HKLM "Software\Classes\.gpg"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.asc"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.pgp"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.sig"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.pem"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.p7m"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.p7s"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.crl"
-  DeleteRegKey /ifempty HKLM "Software\Classes\.arl"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.gpg"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.asc"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.pgp"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.sig"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.pem"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.p7m"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.p7s"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.crl"
+  DeleteRegKey /ifempty SHCTX "Software\Classes\.arl"
 !endif
 SectionEnd