[PATCH] Cygwin: Use a separate Start Menu folder for WoW64 installs

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Cygwin: Use a separate Start Menu folder for WoW64 installs

Jon TURNEY
This aligns the shortcuts to documentation with the setup changes in
https://sourceware.org/pipermail/cygwin-apps/2020-March/039873.html
---
 winsup/doc/etc.postinstall.cygwin-doc.sh | 3 ++-
 winsup/doc/etc.preremove.cygwin-doc.sh   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/winsup/doc/etc.postinstall.cygwin-doc.sh b/winsup/doc/etc.postinstall.cygwin-doc.sh
index de7d9e0c3..65ce2ad77 100755
--- a/winsup/doc/etc.postinstall.cygwin-doc.sh
+++ b/winsup/doc/etc.postinstall.cygwin-doc.sh
@@ -37,7 +37,8 @@ do
 done
 
 # Cygwin Start Menu directory
-smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
+case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
+smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
 
 # check Cygwin Start Menu directory exists
 [ -d "$smpc_dir/" ] || exit 0
diff --git a/winsup/doc/etc.preremove.cygwin-doc.sh b/winsup/doc/etc.preremove.cygwin-doc.sh
index 5e47eb579..f07b70c5d 100755
--- a/winsup/doc/etc.preremove.cygwin-doc.sh
+++ b/winsup/doc/etc.preremove.cygwin-doc.sh
@@ -26,7 +26,8 @@ do
 done
 
 # Cygwin Start Menu directory
-smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
+case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
+smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
 
 # check Cygwin Start Menu directory still exists
 [ -d "$smpc_dir/" ] || exit 0
--
2.21.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Cygwin: Use a separate Start Menu folder for WoW64 installs

Corinna Vinschen-2
On Mar 19 13:58, Jon Turney wrote:

> This aligns the shortcuts to documentation with the setup changes in
> https://sourceware.org/pipermail/cygwin-apps/2020-March/039873.html
> ---
>  winsup/doc/etc.postinstall.cygwin-doc.sh | 3 ++-
>  winsup/doc/etc.preremove.cygwin-doc.sh   | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/winsup/doc/etc.postinstall.cygwin-doc.sh b/winsup/doc/etc.postinstall.cygwin-doc.sh
> index de7d9e0c3..65ce2ad77 100755
> --- a/winsup/doc/etc.postinstall.cygwin-doc.sh
> +++ b/winsup/doc/etc.postinstall.cygwin-doc.sh
> @@ -37,7 +37,8 @@ do
>  done
>  
>  # Cygwin Start Menu directory
> -smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
> +case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
> +smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
>  
>  # check Cygwin Start Menu directory exists
>  [ -d "$smpc_dir/" ] || exit 0
> diff --git a/winsup/doc/etc.preremove.cygwin-doc.sh b/winsup/doc/etc.preremove.cygwin-doc.sh
> index 5e47eb579..f07b70c5d 100755
> --- a/winsup/doc/etc.preremove.cygwin-doc.sh
> +++ b/winsup/doc/etc.preremove.cygwin-doc.sh
> @@ -26,7 +26,8 @@ do
>  done
>  
>  # Cygwin Start Menu directory
> -smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
> +case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
> +smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
>  
>  # check Cygwin Start Menu directory still exists
>  [ -d "$smpc_dir/" ] || exit 0
> --
> 2.21.0
Good idea, please push.


Thanks,
Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Cygwin: Use a separate Start Menu folder for WoW64 installs

Corinna Vinschen-2
On Mar 19 16:02, Corinna Vinschen wrote:

> On Mar 19 13:58, Jon Turney wrote:
> > This aligns the shortcuts to documentation with the setup changes in
> > https://sourceware.org/pipermail/cygwin-apps/2020-March/039873.html
> > ---
> >  winsup/doc/etc.postinstall.cygwin-doc.sh | 3 ++-
> >  winsup/doc/etc.preremove.cygwin-doc.sh   | 3 ++-
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/winsup/doc/etc.postinstall.cygwin-doc.sh b/winsup/doc/etc.postinstall.cygwin-doc.sh
> > index de7d9e0c3..65ce2ad77 100755
> > --- a/winsup/doc/etc.postinstall.cygwin-doc.sh
> > +++ b/winsup/doc/etc.postinstall.cygwin-doc.sh
> > @@ -37,7 +37,8 @@ do
> >  done
> >  
> >  # Cygwin Start Menu directory
> > -smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
> > +case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
> > +smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
> >  
> >  # check Cygwin Start Menu directory exists
> >  [ -d "$smpc_dir/" ] || exit 0
> > diff --git a/winsup/doc/etc.preremove.cygwin-doc.sh b/winsup/doc/etc.preremove.cygwin-doc.sh
> > index 5e47eb579..f07b70c5d 100755
> > --- a/winsup/doc/etc.preremove.cygwin-doc.sh
> > +++ b/winsup/doc/etc.preremove.cygwin-doc.sh
> > @@ -26,7 +26,8 @@ do
> >  done
> >  
> >  # Cygwin Start Menu directory
> > -smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
> > +case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
> > +smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
> >  
> >  # check Cygwin Start Menu directory still exists
> >  [ -d "$smpc_dir/" ] || exit 0
> > --
> > 2.21.0
>
> Good idea, please push.
...this requires a new release of setup and Cygwin in lockstep, right?


Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Cygwin: Use a separate Start Menu folder for WoW64 installs

Jon TURNEY
On 19/03/2020 15:04, Corinna Vinschen wrote:
> On Mar 19 16:02, Corinna Vinschen wrote:
>> On Mar 19 13:58, Jon Turney wrote:
>>> This aligns the shortcuts to documentation with the setup changes in
>>> https://sourceware.org/pipermail/cygwin-apps/2020-March/039873.html
[...]
>> Good idea, please push.
>
> ...this requires a new release of setup and Cygwin in lockstep, right?

Worse than that, since this postinstall script checks if smpc_dir
exists, and does nothing if it doesn't.

So I think I probably want to change that to creating the smpc_dir if it
doesn't exist, so we don't require that the updated setup has run (and
completed, creating that directory) before we run that postinstall script.

Sigh.


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Cygwin: Use a separate Start Menu folder for WoW64 installs

Corinna Vinschen-2
On Mar 19 15:40, Jon Turney wrote:

> On 19/03/2020 15:04, Corinna Vinschen wrote:
> > On Mar 19 16:02, Corinna Vinschen wrote:
> > > On Mar 19 13:58, Jon Turney wrote:
> > > > This aligns the shortcuts to documentation with the setup changes in
> > > > https://sourceware.org/pipermail/cygwin-apps/2020-March/039873.html
> [...]
> > > Good idea, please push.
> >
> > ...this requires a new release of setup and Cygwin in lockstep, right?
>
> Worse than that, since this postinstall script checks if smpc_dir exists,
> and does nothing if it doesn't.
>
> So I think I probably want to change that to creating the smpc_dir if it
> doesn't exist, so we don't require that the updated setup has run (and
> completed, creating that directory) before we run that postinstall script.
>
> Sigh.
No worries.  You have free reign over that postinstall issue.  Just
go ahead as you see fit.


Thanks,
Corinna

--
Corinna Vinschen
Cygwin Maintainer

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[PATCH] Cygwin: Use a separate Start Menu folder for WoW64 installs

Jon TURNEY
This aligns the shortcuts to documentation with the setup changes in
https://sourceware.org/pipermail/cygwin-apps/2020-March/039873.html

v2:
Create/remove the Start Menu directory as needed/possible
Correctly use that directory when making shortcuts
---
 winsup/doc/etc.postinstall.cygwin-doc.sh | 12 ++++++------
 winsup/doc/etc.preremove.cygwin-doc.sh   |  5 ++++-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/winsup/doc/etc.postinstall.cygwin-doc.sh b/winsup/doc/etc.postinstall.cygwin-doc.sh
index de7d9e0c3..97f88a16d 100755
--- a/winsup/doc/etc.postinstall.cygwin-doc.sh
+++ b/winsup/doc/etc.postinstall.cygwin-doc.sh
@@ -37,10 +37,11 @@ do
 done
 
 # Cygwin Start Menu directory
-smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
+case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
+smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
 
-# check Cygwin Start Menu directory exists
-[ -d "$smpc_dir/" ] || exit 0
+# ensure Cygwin Start Menu directory exists
+/usr/bin/mkdir -p "$smpc_dir"
 
 # check Cygwin Start Menu directory writable
 if [ ! -w "$smpc_dir/" ]
@@ -52,7 +53,7 @@ fi
 # create User Guide and API PDF and HTML shortcuts
 while read target name desc
 do
- [ -r "$target" ] && $mks $CYGWINFORALL -P -n "Cygwin/$name" -d "$desc" -- $target
+ [ -r "$target" ] && $mks $CYGWINFORALL -P -n "Cygwin${wow64}/$name" -d "$desc" -- $target
 done <<EOF
 $doc/cygwin-ug-net.pdf User\ Guide\ \(PDF\)  Cygwin\ User\ Guide\ PDF
 $html/cygwin-ug-net/index.html User\ Guide\ \(HTML\) Cygwin\ User\ Guide\ HTML
@@ -63,9 +64,8 @@ EOF
 # create Home Page and FAQ URL link shortcuts
 while read target name desc
 do
- $mks $CYGWINFORALL -P -n "Cygwin/$name" -d "$desc" -a $target -- $launch
+ $mks $CYGWINFORALL -P -n "Cygwin${wow64}/$name" -d "$desc" -a $target -- $launch
 done <<EOF
 $site/index.html Home\ Page Cygwin\ Home\ Page\ Link
 $site/faq.html FAQ Cygwin\ Frequently\ Asked\ Questions\ Link
 EOF
-
diff --git a/winsup/doc/etc.preremove.cygwin-doc.sh b/winsup/doc/etc.preremove.cygwin-doc.sh
index 5e47eb579..b098e6dac 100755
--- a/winsup/doc/etc.preremove.cygwin-doc.sh
+++ b/winsup/doc/etc.preremove.cygwin-doc.sh
@@ -26,7 +26,8 @@ do
 done
 
 # Cygwin Start Menu directory
-smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin"
+case $(uname -s) in *-WOW*) wow64=" (32-bit)" ;; esac
+smpc_dir="$($cygp $CYGWINFORALL -P -U --)/Cygwin${wow64}"
 
 # check Cygwin Start Menu directory still exists
 [ -d "$smpc_dir/" ] || exit 0
@@ -52,3 +53,5 @@ $site/index.html Home\ Page Cygwin\ Home\ Page\ Link
 $site/faq.html FAQ Cygwin\ Frequently\ Asked\ Questions\ Link
 EOF
 
+# remove Cygwin Start Menu directory if empty
+/usr/bin/rmdir --ignore-fail-on-non-empty "${smpc_dir}"
--
2.21.0