public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: "cygwin-apps@cygwin.com" <cygwin-apps@cygwin.com>
Subject: Re: [PATCH setup] Add new option --no-write-registry
Date: Tue, 12 Jul 2022 19:04:06 +0200	[thread overview]
Message-ID: <3794a408-44c4-bbda-0b3c-44a170306ca7@t-online.de> (raw)
In-Reply-To: <7b954e44-601f-6448-c0a1-636be014635f@dronecode.org.uk>

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

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),


[-- Attachment #2: 0001-Add-new-option-no-write-registry.patch --]
[-- Type: text/plain, Size: 3038 bytes --]

From 8a93babe4ef963de9fe1d2f5ba77ea9c89afa23c Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@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	other threads:[~2022-07-12 17:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09 15:59 Christian Franke
2022-07-12 12:50 ` Jon Turney
2022-07-12 17:04   ` Christian Franke [this message]
2022-07-16 13:48     ` Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3794a408-44c4-bbda-0b3c-44a170306ca7@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).