summaryrefslogtreecommitdiff
path: root/Master/tlpkg/doc/wingoo-demo.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/doc/wingoo-demo.pl')
-rw-r--r--Master/tlpkg/doc/wingoo-demo.pl56
1 files changed, 32 insertions, 24 deletions
diff --git a/Master/tlpkg/doc/wingoo-demo.pl b/Master/tlpkg/doc/wingoo-demo.pl
index 1b2944e9385..84c0a455a77 100644
--- a/Master/tlpkg/doc/wingoo-demo.pl
+++ b/Master/tlpkg/doc/wingoo-demo.pl
@@ -26,7 +26,9 @@ BEGIN {
}
use TeXLive::TLUtils qw( get_system_tmpdir );
-use TeXLive::TLWinGoo qw(
+use TeXLive::TLWinGooTry qw(
+ &win_version
+ &is_vista
&admin
&non_admin
&admin_again
@@ -65,13 +67,12 @@ sub maybenot {
sub create_file {
my $name = shift;
- return if -e $name;
- eval {
- open DUMMY, ">".$name;
- print DUMMY 's = tostring(0.0000001)'; # lua: 1e-7; texlua: 0
- print DUMMY ('print("0.0000001 becomes " .. s)');
- close DUMMY;
- } ;
+ return 1 if -e $name;
+ return 0 unless open DUMMY, ">".$name;
+ print DUMMY 's = tostring(0.0000001)'; # lua: 1e-7; texlua: 0
+ print DUMMY ('print("0.0000001 becomes " .. s)');
+ close DUMMY;
+ return 1;
}
sub print_search_paths {
@@ -130,6 +131,11 @@ if (admin()) {
print "\nGlobal tempdir: " . global_tmpdir()."\n";
+# Windows version
+
+print "Windows version: ".win_version()."\n";
+print maybenot(is_vista()). " Vista\n";
+
if ($^O !~ /^MSWin(32|64)$/i) {
print "Not Windows; bailing out...\n";
exit;
@@ -137,8 +143,8 @@ if ($^O !~ /^MSWin(32|64)$/i) {
### end of non-windows
-my @winversion = Win32::GetOSVersion();
-print "Windows version: " . $winversion[1] . "\n";
+#my @winversion = Win32::GetOSVersion();
+#print "Windows version: " . $winversion[1] . "\n";
# country
@@ -222,30 +228,32 @@ while (1) { # running this first as admin (if possible) and then as non-admin
if (admin()) {
non_admin();
next;
- } elsif ($winversion[1]>=6) { last; }
- #vista: don't try this
+ }
# the problem case: no admin, but TeX on system path
print( "\nNon-admin path problem\n" );
my $fn = expand_string("%windir%")."/TEX.EXE";
$fn =~ s/\\/\//g;
- create_file($fn); # a tex.exe on the system path!
- add_texbindir_to_path(expand_string($wr_dir2));
- my @wge = wg_error();
- if (@wge) {
- print $wge[1]."\n";
+ if (create_file($fn)) { # a tex.exe on the system path!
+ add_texbindir_to_path(expand_string($wr_dir2));
+ my @wge = wg_error();
+ if (@wge) {
+ print $wge[1]."\n";
+ }
+ print( "Cannot remove tex from system searchpath\n" );
+ print_search_paths();
+ print "Wrong tex.exe found in " . win_which_dir("tex.exe") . "\n";
+ unlink $fn;
+ remove_texbindirs_from_path();
+ broadcast_env();
+ pause( "Non-admin: check environment in new dosbox" );
+ } else {
+ print "Cannot test; cannot create $fn\n";
}
- print( "Cannot remove tex from system searchpath\n" );
- print_search_paths();
- print "Wrong tex.exe found in " . win_which_dir("tex.exe") . "\n";
- unlink $fn;
- remove_texbindirs_from_path();
# broadcast environment changes
- broadcast_env();
- pause( "Non-admin: check environment in new dosbox" );
if (!admin()) { last; }
}