Add support for minimal cmd line switch
authorAndre Heinecke <aheinecke@intevation.de>
Sun, 14 May 2017 10:17:15 +0000 (12:17 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Sun, 14 May 2017 10:17:15 +0000 (12:17 +0200)
* src/gpg4win.nsi: Add new var.
* src/inst-sections.nsi: Select sections based on minimal.
* src/installer.nsi: Handle cmd line switch.

--
GnuPG-Bug-ID: T3104

src/gpg4win.nsi
src/inst-sections.nsi
src/installer.nsi

index 4f3dc43..e26863c 100644 (file)
@@ -171,6 +171,9 @@ SetCompressor /SOLID lzma
 !include "uninst-claws-mail.nsi"
 !endif
 
+# Variables
+VAR is_minimal
+
 # Sections
 !include "Sections.nsh"
 
index c8075e9..1bd2a50 100644 (file)
@@ -510,6 +510,21 @@ calc_defaults_man_advanced_de_done:
 calc_defaults_man_advanced_en_done:
 !endif
 
+# Check if minimal install was requested on the command line
+
+StrCmp $is_minimal '1' select_minimal continue
+select_minimal:
+   !insertmacro UnselectSection ${SEC_kleopatra}
+   !insertmacro UnselectSection ${SEC_gpgol}
+   !insertmacro UnselectSection ${SEC_gpgex}
+   !insertmacro UnselectSection ${SEC_gpa}
+   !insertmacro UnselectSection ${SEC_compendium}
+
+# We only do pinentry and gnupg-w32
+   !insertmacro SelectSection ${SEC_paperkey}
+   !insertmacro SelectSection ${SEC_gnupg_w32}
+   !insertmacro SelectSection ${SEC_pinentry}
+continue:
 FunctionEnd
 
 
index 28eccc2..040d3ff 100644 (file)
@@ -671,6 +671,10 @@ Function .onInit
   Delete $TEMP\gpgspltmp.bmp
   # Note that we delete gpgspltmp.wav in .onInst{Failed,Success}
 !endif
+  ${GetParameters} $R0
+  ClearErrors
+  ${GetOptions} $R0 /MINIMAL= $is_minimal
+
   Var /GLOBAL changed_dir
   # Check if the install directory was modified on the command line
   StrCmp "$INSTDIR" "$PROGRAMFILES\${INSTALL_DIR}" unmodified 0