diff options
Diffstat (limited to 'Master/tlpkg/doc/wingoo-demo.pl')
-rw-r--r-- | Master/tlpkg/doc/wingoo-demo.pl | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/Master/tlpkg/doc/wingoo-demo.pl b/Master/tlpkg/doc/wingoo-demo.pl index 112d2bc1e69..1b2944e9385 100644 --- a/Master/tlpkg/doc/wingoo-demo.pl +++ b/Master/tlpkg/doc/wingoo-demo.pl @@ -66,10 +66,12 @@ sub maybenot { sub create_file { my $name = shift; return if -e $name; - open DUMMY, ">".$name; - print DUMMY 's = tostring(0.0000001)'; # lua: 1e-7; texlua: 0 - print DUMMY ('print("0.0000001 becomes " .. s)'); - close DUMMY; + eval { + open DUMMY, ">".$name; + print DUMMY 's = tostring(0.0000001)'; # lua: 1e-7; texlua: 0 + print DUMMY ('print("0.0000001 becomes " .. s)'); + close DUMMY; + } ; } sub print_search_paths { @@ -111,10 +113,7 @@ sub pause { ### end of subs ### my $real_admin = admin(); -my $userpath_orig; -my $systempath_orig; -my $userpathext_orig; -my $systempathext_orig; + print( "\nGENERAL; ALSO UNIX\n" ); print ( "\nINC\n" . (join "\n", @INC) . "\n\n"); @@ -138,6 +137,9 @@ if ($^O !~ /^MSWin(32|64)$/i) { ### end of non-windows +my @winversion = Win32::GetOSVersion(); +print "Windows version: " . $winversion[1] . "\n"; + # country print "Country: " . reg_country() . "\n"; @@ -164,6 +166,7 @@ my $system_tmpdir=get_system_tmpdir(); print( "\n\nHKCU and HKLM\n\n" ); +my ($wr_dir1, $wr_dir2); while (1) { # running this first as admin (if possible) and then as non-admin print ((admin() ? "Is" : "Not") . " an admin\n"); @@ -171,7 +174,7 @@ while (1) { # running this first as admin (if possible) and then as non-admin # adding and removing texbindir print( "\ntexbindir on searchpath:\n" ); - my $wr_dir1 = $wr_dir . "/tex1"; + $wr_dir1 = $wr_dir . "/tex1"; mkdir $wr_dir1 unless -e $wr_dir1; create_file( $wr_dir1."/tex.exe" ); add_texbindir_to_path($wr_dir1); @@ -179,7 +182,7 @@ while (1) { # running this first as admin (if possible) and then as non-admin print_search_paths(); print "tex.exe found in " . win_which_dir("tex.exe") . "\n"; - my $wr_dir2 = $wr_dir . "/tex2"; + $wr_dir2 = $wr_dir . "/tex2"; mkdir $wr_dir2 unless -e $wr_dir2; create_file( $wr_dir2."/tex.exe" ); add_texbindir_to_path($wr_dir2); @@ -189,9 +192,6 @@ while (1) { # running this first as admin (if possible) and then as non-admin print( "Mopping up...\n" ); remove_texbindirs_from_path(); - rmdir $wr_dir1 if unlink $wr_dir1.'/tex.exe'; - rmdir $wr_dir2 if unlink $wr_dir2.'/tex.exe'; - print( "Dummy texs removed from path\n"); print_search_paths(); # adding a filetype @@ -222,7 +222,8 @@ 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 @@ -240,7 +241,6 @@ while (1) { # running this first as admin (if possible) and then as non-admin print "Wrong tex.exe found in " . win_which_dir("tex.exe") . "\n"; unlink $fn; remove_texbindirs_from_path(); - rmdir $wr_dir2 if unlink $wr_dir2.'/tex.exe'; # broadcast environment changes @@ -249,6 +249,9 @@ while (1) { # running this first as admin (if possible) and then as non-admin if (!admin()) { last; } } +rmdir $wr_dir1 if unlink $wr_dir1.'/tex.exe'; +rmdir $wr_dir2 if unlink $wr_dir2.'/tex.exe'; +print( "Dummy texs removed from path\n"); admin_again() if $real_admin; unregister_script_type(".texlua"); |