Jon Turney wrote:
On 09/07/2022 16:59, Christian Franke wrote:
IMO useful for temporary test installs or "portable" installs to USB devices.

The 0002-patch adds a related log message.

These patches are ok.

If you can provide a help-text for the new option, I will apply them.

Attached new version of 0001-... patch which includes a help text.
Does not include the *.po* changes, sorry ('pip install translate-toolkit' failed for some reason),

From 8a93babe4ef963de9fe1d2f5ba77ea9c89afa23c Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.fra...@t-online.de>
Date: Tue, 12 Jul 2022 18:04:25 +0200
Subject: [PATCH] Add new option --no-write-registry

If specified, the rootdir is not written to the registry and no
registry key is created.
---
 install.cc    | 6 ++++--
 res/en/res.rc | 1 +
 res/fr/res.rc | 1 +
 resource.h    | 1 +
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/install.cc b/install.cc
index 1fdc699..fbd28b1 100644
--- a/install.cc
+++ b/install.cc
@@ -70,6 +70,7 @@ static long long int total_bytes_sofar = 0;
 static int package_bytes = 0;
 
 static BoolOption NoReplaceOnReboot (false, 'r', "no-replaceonreboot", 
IDS_HELPTEXT_NO_REPLACEONREBOOT);
+static BoolOption NoWriteRegistry (false, '\0', "no-write-registry", 
IDS_HELPTEXT_NO_WRITE_REGISTRY);
 
 struct std_dirs_t {
   const char *name;
@@ -833,8 +834,9 @@ do_install_thread (HINSTANCE h, HWND owner)
   int df = diskfull (get_root_dir ().c_str());
   Progress.SetBar3 (df);
 
-  /* Writes Cygwin/setup/rootdir registry value */
-  create_install_root ();
+  if (!NoWriteRegistry)
+    /* Writes Cygwin/setup/rootdir registry value */
+    create_install_root ();
 
   std::vector <packageversion> install_q, uninstall_q, sourceinstall_q;
 
diff --git a/res/en/res.rc b/res/en/res.rc
index 9683ab5..644b252 100644
--- a/res/en/res.rc
+++ b/res/en/res.rc
@@ -679,6 +679,7 @@ BEGIN
     IDS_HELPTEXT_NO_VERIFY "Don't verify setup.ini signatures"
     IDS_HELPTEXT_NO_VERSION_CHECK "Suppress checking if a newer version of 
setup is available"
     IDS_HELPTEXT_NO_WARN_DEPRECATED_WINDOWS "Don't warn about deprecated 
Windows versions"
+    IDS_HELPTEXT_NO_WRITE_REGISTRY "Don't write root installation directory to 
registry"
     IDS_HELPTEXT_OLD_KEYS "Enable old cygwin.com keys"
     IDS_HELPTEXT_ONLY_SITE "Do not download mirror list.  Only use sites 
specified with -s."
     IDS_HELPTEXT_PACKAGES "Specify packages to install"
diff --git a/res/fr/res.rc b/res/fr/res.rc
index 79f2371..a0a7909 100644
--- a/res/fr/res.rc
+++ b/res/fr/res.rc
@@ -665,6 +665,7 @@ BEGIN
     IDS_HELPTEXT_NO_VERIFY "Ne pas vérifier les signatures de setup.ini"
     IDS_HELPTEXT_NO_VERSION_CHECK "Ne pas vérifier si une version plus récente 
de l'assistant est disponible"
     IDS_HELPTEXT_NO_WARN_DEPRECATED_WINDOWS "Ne pas avertir pour les vieilles 
versions de Windows"
+    // IDS_HELPTEXT_NO_WRITE_REGISTRY "XXX: missing translation"
     IDS_HELPTEXT_OLD_KEYS "Utiliser les anciennes clés de cygwin.com"
     IDS_HELPTEXT_ONLY_SITE "Ignorer tous les sites sauf ceux spécifiés par -s"
     IDS_HELPTEXT_PACKAGES "Spécifie les paquets à installer"
diff --git a/resource.h b/resource.h
index e8ed0fa..2668dd9 100644
--- a/resource.h
+++ b/resource.h
@@ -154,6 +154,7 @@
 #define IDS_HELPTEXT_ERROR               1545
 #define IDS_HELPTEXT_HEADER              1546
 #define IDS_HELPTEXT_FOOTER              1547
+#define IDS_HELPTEXT_NO_WRITE_REGISTRY   1548
 
 // Dialogs
 
-- 
2.37.0

Reply via email to