summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/TeXLive/TLWinGoo.pm85
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl2
-rw-r--r--Master/tlpkg/installer/install-menu-text.pl2
3 files changed, 61 insertions, 28 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm
index e04f01c3cb2..36ae998c70c 100644
--- a/Master/tlpkg/TeXLive/TLWinGoo.pm
+++ b/Master/tlpkg/TeXLive/TLWinGoo.pm
@@ -34,8 +34,9 @@ C<TeXLive::TLWinGoo> -- Additional utilities for Windows
=head2 DIAGNOSTICS
- TeXLive::TLWinGoo::win_version;
TeXLive::TLWinGoo::is_vista;
+ TeXLive::TLWinGoo::is_seven;
+ TeXLive::TLWinGoo::is_ten;
TeXLive::TLWinGoo::admin;
TeXLive::TLWinGoo::non_admin;
TeXLive::TLWinGoo::reg_country;
@@ -93,11 +94,12 @@ BEGIN {
@ISA = qw( Exporter );
@EXPORT = qw(
&is_vista
+ &is_seven
+ &is_ten
&admin
&non_admin
);
@EXPORT_OK = qw(
- &win_version
&admin_again
&reg_country
&broadcast_env
@@ -194,23 +196,48 @@ registry: 5.0 for Windows 2000, 5.1 for Windows XP and 6.0 for Vista.
=cut
my $windows_version = 0;
+my $windows_subversion = 0;
if ($is_win) {
- my @osver = Win32::GetOSVersion();
- $windows_version = $osver[1];
- debug "Windows version $osver[0], major version $osver[1]\n";
+ #my @osver = Win32::GetOSVersion(); # deprecated
+ #$windows_version = $osver[1];
+ #debug "Windows version $osver[0], major version $osver[1]\n";
+ my $ver = `ver`;
+ chomp $ver;
+ $ver =~ s/^[^0-9]*//;
+ $ver =~ s/[^0-9.]*$//;
+ ($windows_version = $ver) =~ s/\..*$//;
+ ($windows_subversion = $ver) =~ s/^[^\.]*\.//;
+ $windows_subversion =~ s/\..*$//;
}
-sub win_version { return $windows_version; }
-
=item C<is_vista>
-C<is_vista> returns 1 if win_version is >= 6.0, otherwise 0.
+C<is_vista> returns 1 if windows version is >= 6.0, otherwise 0.
=cut
sub is_vista { return $windows_version >= 6; }
+=item C<is_seven>
+
+C<is_seven> returns 1 if windows version is >= 6.1, otherwise 0.
+
+=cut
+
+sub is_seven {
+ return (($windows_version == 6 && $windows_subversion >= 1) ||
+ ($windows_version > 6));
+}
+
+=item C<is_ten>
+
+C<is_ten> returns 1 if windows version is >= 10.0, otherwise 0.
+
+=cut
+
+sub is_ten { return $windows_version >= 10; }
+
# permissions with which we try to access the system environment
my $is_admin = 1;
@@ -1237,25 +1264,31 @@ UNEND3
"$uninst_dir\\uninst.bat", "", 0);
}
# register uninstaller
- &log("Registering uninstaller\n");
- my $k;
- my $uninst_key = $Registry -> Open((admin() ? "LMachine" : "CUser") .
- "/software/microsoft/windows/currentversion/",
- {Access => KEY_FULL_ACCESS()});
- if ($uninst_key) {
- $k = $uninst_key->CreateKey(
- "uninstall/TeXLive$::TeXLive::TLConfig::ReleaseYear/");
- if ($k) {
- $k->{"/DisplayName"} = "TeX Live $::TeXLive::TLConfig::ReleaseYear";
- $k->{"/UninstallString"} = "\"$td\\tlpkg\\installer\\uninst.bat\"";
- $k->{'/DisplayVersion'} = $::TeXLive::TLConfig::ReleaseYear;
- $k->{'/URLInfoAbout'} = "http://www.tug.org/texlive";
+ # but not for a user install under win10 because then
+ # it shows up in Settings / Apps / Apps & features,
+ # where it will trigger an inappropriate UAC prompt
+ if (admin() || !is_ten()) {
+ &log("Registering uninstaller\n");
+ my $k;
+ my $uninst_key = $Registry -> Open((admin() ? "LMachine" : "CUser") .
+ "/software/microsoft/windows/currentversion/",
+ {Access => KEY_FULL_ACCESS()});
+ if ($uninst_key) {
+ $k = $uninst_key->CreateKey(
+ "uninstall/TeXLive$::TeXLive::TLConfig::ReleaseYear/");
+ if ($k) {
+ $k->{"/DisplayName"} = "TeX Live $::TeXLive::TLConfig::ReleaseYear";
+ $k->{"/UninstallString"} = "\"$td\\tlpkg\\installer\\uninst.bat\"";
+ $k->{'/DisplayVersion'} = $::TeXLive::TLConfig::ReleaseYear;
+ $k->{'/Publisher'} = 'TeX Live';
+ $k->{'/URLInfoAbout'} = "http://www.tug.org/texlive";
+ }
+ }
+ if (!$k and admin()) {
+ tlwarn("Failed to register uninstaller\n".
+ "You can still run $td\\tlpkg\\installer\\uninst.bat manually.\n");
+ return 0;
}
- }
- if (!$k and admin()) {
- tlwarn("Failed to register uninstaller\n".
- "You can still run $td\\tlpkg\\installer\\uninst.bat manually.\n");
- return 0;
}
}
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl
index 2d5cc3a3e62..c18a6ccc352 100644
--- a/Master/tlpkg/installer/install-menu-perltk.pl
+++ b/Master/tlpkg/installer/install-menu-perltk.pl
@@ -63,7 +63,7 @@ $::letterdesc[1] = __('letter');
$::deskintdesc[0] = __("No shortcuts");
$::deskintdesc[1] = __("TeX Live menu");
-if (win32() && is_vista()) { $::deskintdesc[2] = __("Launcher entry"); }
+if (win32() && is_seven()) { $::deskintdesc[2] = __("Launcher entry"); }
# generic option strings:
$::yesno[0] = __('No');
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl
index b7c1dba2e43..caa8ec50e21 100644
--- a/Master/tlpkg/installer/install-menu-text.pl
+++ b/Master/tlpkg/installer/install-menu-text.pl
@@ -40,7 +40,7 @@ $::fileassocdesc[2] = "All";
$::deskintdesc[0] = "None";
$::deskintdesc[1] = "Menu shortcuts";
-if (win32() && is_vista()) { $::deskintdesc[2] = "Launcher"; }
+if (win32() && is_seven()) { $::deskintdesc[2] = "Launcher"; }
sub clear_screen {
return 0 if ($::opt_no_cls);