diff options
-rwxr-xr-x | Master/install-tl.pl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl index b94225745ca..fccee377bf2 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -192,6 +192,11 @@ calc_depends(); prepare_installation(); do_install_packages(); do_postinst_stuff(); + +if (win32()) { + do_win_registry_magic(); +} + dump_vars("$system_tmpdir/texlive.vars"); # if we installed from a profile we don't need to write it out if (-r "$vars{'TEXDIR'}/$InfraLocation/texlive.profile") { @@ -660,6 +665,36 @@ sub do_texmf_cnf { close(TMF); } +# register texlua handlers etc etc +sub do_win_registry_magic { + # we are called under if (win32()) !! + if ($vars{'win-admin'}) { + # generate a .texlua association and link it to texlua.exe, which should + # be in the path! + my $classes = $Registry->Open( "Classes/", {Access=>KEY_ALL_ACCESS,Delimiter=>"/"}); + $classes->CreateKey(".texlua")->SetValue("","script.texlua"); + my $scriptkey = $classes->CreateKey("script.texlua"); + $scriptkey->SetValue("", "TeXLua Script"); + $scriptkey->CreateKey("Shell/Open/Command/")->SetValue("","texlua.exe %1"); + + # PATHEXT editing + # should this be currentcontrolset or ControlSet001 ???? + my $winenv = $Registry->Open( "LMachine/SYSTEM/ControlSet001/Control/Session Manager/Environment/", {Access=>KEY_ALL_ACCESS,Delimiter=>"/"}); + my $pathext = $winenv->GetValue("PATHEXT"); + my $found = 0; + foreach (split(/;/,$pathext)) { + $found = 1 if (m/\.texlua/i); + } + if (!$found) { + $winenv->SetValue("PATHEXT","$pathext;.texlua"); + } + + # add the win32 dir to the PATH + warn "Missing: extend PATH to include TEXDIR/bin/win32\n"; + } else { + warn "Don't know what to do if a non admin user installs texlive on win32\n!; + } +} __END__ ### Local Variables: |