Skip to content

Commit

Permalink
MiKTeX post-install script working
Browse files Browse the repository at this point in the history
Modified MiKTeX post-install script to get it working.
Tested against MiKTeX on Windows 7.  Requires installer to be run as administrator, but works.
  • Loading branch information
rpspringuel committed May 17, 2015
1 parent 1746b03 commit e34916e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
5 changes: 2 additions & 3 deletions windows/gregorio.iss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Source: "../tex/gregoriotex.tex"; DestDir: "{app}\texmf\tex\luatex\gregoriotex";
Source: "../tex/gregoriotex.sty"; DestDir: "{app}\texmf\tex\luatex\gregoriotex";
Source: "../tex/gregoriotex.lua"; DestDir: "{app}\texmf\tex\luatex\gregoriotex";
Source: "../tex/gregoriotex-chars.tex"; DestDir: "{app}\texmf\tex\luatex\gregoriotex";
Source: "../tex/gregoriotex-ictus.tex"; DestDir: "{app}\texmf\tex\luatex\gregoriotex";
Source: "../tex/gregoriotex-signs.tex"; DestDir: "{app}\texmf\tex\luatex\gregoriotex";
Source: "../tex/gregoriotex-spaces.tex"; DestDir: "{app}\texmf\tex\luatex\gregoriotex";
Source: "../tex/gregoriotex-syllable.tex"; DestDir: "{app}\texmf\tex\luatex\gregoriotex";
Expand All @@ -77,7 +76,7 @@ Source: "../fonts/gregorio.ttf"; DestDir: "{app}\texmf\fonts\truetype\public\gre
Source: "../fonts/greextra.ttf"; DestDir: "{app}\texmf\fonts\truetype\public\gregoriotex";
Source: "../fonts/gresym.ttf"; DestDir: "{app}\texmf\fonts\truetype\public\gregoriotex";
Source: "../fonts/parmesan.ttf"; DestDir: "{app}\texmf\fonts\truetype\public\gregoriotex";
Source: "../fonts/convertsfrtottf.py"; DestDir: "{app}\texmf\fonts\source\gregoriotex";
Source: "../fonts/convertsfdtottf.py"; DestDir: "{app}\texmf\fonts\source\gregoriotex";
Source: "../fonts/greciliae-base.sfd"; DestDir: "{app}\texmf\fonts\source\gregoriotex";
Source: "../fonts/greextra.sfd"; DestDir: "{app}\texmf\fonts\source\gregoriotex";
Source: "../fonts/gregorio-base.sfd"; DestDir: "{app}\texmf\fonts\source\gregoriotex";
Expand All @@ -89,7 +88,7 @@ Source: "../README.md"; DestDir: "{app}\texmf\doc\luatex\gregoriotex";

[Run]
Filename: "texlua.exe"; Parameters: """{app}\install-tl.lua"" > ""{app}\install-tl.log"""; StatusMsg: "Configuring TeXLive texmf..."; Description: "Add files to TeXLive texmf tree"; Flags: postinstall ; WorkingDir: "{app}";
Filename: "texlua.exe"; Parameters: """{app}\install-mt.lua"" > ""{app}\install-mt.log"""; StatusMsg: "Configuring MiKTeX texmf..."; Description: "Add files to MiKTeK texmf tree"; Flags: postinstall ; WorkingDir: "{app}";
Filename: "texlua.exe"; Parameters: """{app}\install-mt.lua"" > ""{app}\install-mt.log"""; StatusMsg: "Configuring MiKTeX texmf..."; Description: "Make files available to MiKTeK"; Flags: postinstall ; WorkingDir: "{app}";

[Code]
procedure URLLabelOnClickOne(Sender: TObject);
Expand Down
21 changes: 13 additions & 8 deletions windows/install-mt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,24 @@ function copy_files()
lfs.mkdir(texmflocal)
end
print("Copying files...\n")
local texmfbin = kpse.expand_var("$TEXMFDIST")
print(texmfbin)
texmfbin = fixpath(texmfbin.."/../bin/win32/")
print(texmfbin)
local texmfdist = kpse.expand_var("$TEXMFDIST")
--[[ MiKTeX uses slightly different paths for the location of it's bin
directory for 32 and 64 bit versions. Since the copy command will fail
silently if the destination directory doesn't exist, the simplest way to deal
with this is to simply try copying to both locations.
--]]
texmfbin_32 = fixpath(texmfdist.."/miktex/bin/")
texmfbin_64 = fixpath(texmfdist.."/miktex/bin/x64/")
print("gregorio.exe...")
copy_one_file("gregorio.exe", texmfbin)
print("unzipping TDS zip file...\n")
os.spawn("unzip.exe -o gregoriotex.tds.zip -d "..texmflocal:gsub("\\", "/")) -- TeXLive provides unzip!
copy_one_file("gregorio.exe", texmfbin_32)
copy_one_file("gregorio.exe", texmfbin_64)
print("GregorioTeX files...")
os.spawn("xcopy texmf "..texmflocal.." /e /f /y")
end

function run_texcommands()
print("Running initexmf\n")
local p = os.spawn("initexmf -u")
local p = os.spawn("initexmf -u --admin")
end

function main_install()
Expand Down

0 comments on commit e34916e

Please sign in to comment.