summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg')
-rw-r--r--Master/tlpkg/libexec/install-tl.nsi68
1 files changed, 44 insertions, 24 deletions
diff --git a/Master/tlpkg/libexec/install-tl.nsi b/Master/tlpkg/libexec/install-tl.nsi
index dae017f7297..301a629f86a 100644
--- a/Master/tlpkg/libexec/install-tl.nsi
+++ b/Master/tlpkg/libexec/install-tl.nsi
@@ -34,6 +34,7 @@ SubCaption 4 ": Unpacking..."
XPStyle on
RequestExecutionLevel user
+; With this compressor, 7zip can unpack the exe
SetCompressor /SOLID bzip2
; Controls: installation type
@@ -56,12 +57,9 @@ Var Admin_warning
Var Completed_text
CompletedText $Completed_text
Var InstOrUnpack
-;Var NextOrUnpack
-;MiscButtonText "" $NextOrUnpack "" ""
-InstallButtonText $InstOrUnpack
-; for local testing:
-Var REPO
+; parameters to nsis installer are passed along to install-tl.bat
+Var PARMS
Page custom tlOptionsPage tlOptionsPageLeave
Page directory dirPre "" dirLeave
@@ -75,10 +73,10 @@ Function .onInit
"Windows XP earliest supported version; aborting..."
Abort
${EndIf}
-
+
InitPluginsDir
StrCpy $INSTDIR $PLUGINSDIR
-
+
UserInfo::GetAccountType
Pop $0
${If} $0 == "Admin"
@@ -162,7 +160,7 @@ Function tlOptionsPageLeave
${If} $Radio_Value == "unpack"
StrCpy $INSTDIR "$DESKTOP"
StrCpy $Completed_text \
- "Done; next run install-tl.bat or install-tl-advanced.bat."
+ "Done unpacking; next run install-tl.bat or install-tl-advanced.bat."
StrCpy $InstOrUnpack "Unpack"
;StrCpy $NextOrUnpack "Next"
${Else}
@@ -215,13 +213,13 @@ Function ConfirmPage
${If} $Radio_Value == "unpack"
${NSD_CreateLabel} 0 30% 100% 80u \
- "The main installer will be unpacked into $INSTDIR\${INST_TL_NAME}.$\r$\n$\r$\ninstall-tl.bat and install-tl-advanced.bat will start the main installer."
+ "The main installer will be unpacked into $INSTDIR\${INST_TL_NAME}.$\r$\n$\r$\nStart the main installer with install-tl.bat or install-tl-advanced.bat."
${ElseIf} $Radio_Value == "advanced"
${NSD_CreateLabel} 0 30% 100% 80u \
- "Click 'Install' to start the main installer,$\r$\nwhich lets you select components and an installation directory.$\r$\n$\r$\nUnpacking the main installer may take a moment..."
+ "Click 'Install' to start the main installer,$\r$\nwhich lets you select components and an installation directory.$\r$\n$\r$\nUnpacking the main installer may take a few moments..."
${Else}
${NSD_CreateLabel} 0 30% 100% 80u \
- "Click 'Install' to start the main installer,$\r$\nwhich lets you select an installation directory.$\r$\n$\r$\nUnpacking the main installer may take a moment..."
+ "Click 'Install' to start the main installer,$\r$\nwhich lets you select an installation directory.$\r$\n$\r$\nUnpacking the main installer may take a few moments..."
${EndIf}
Pop $Explain
@@ -235,16 +233,12 @@ FunctionEnd
Section
- ${GetParameters} $REPO
- ${If} $REPO != ""
- StrCpy $REPO "-repository $REPO"
+ ${GetParameters} $PARMS
+ ${If} $PARMS != ""
+ DetailPrint $PARMS
${EndIf}
- ; for local testing:
- ; StrCpy $REPO "-repository U:\systems\texlive\tlnet"
- ; StrCpy $REPO "-repository D:\tlnet"
-
+
; Detailprint $Radio_Value
- ; DetailPrint '-- $REPO --'
${If} $Radio_Value == "unpack"
SetOutPath $INSTDIR
${Else}
@@ -255,15 +249,41 @@ Section
CreateDirectory $INSTDIR\${INST_TL_NAME}
- ; production code:
- File /r ${INST_TL_NAME}
; Quick interface testing:
; File /oname=${INST_TL_NAME}\README ${INST_TL_NAME}\README
+ ; production code:
+ File /r ${INST_TL_NAME}
+
+ ${If} $Radio_Value != "unpack"
+ ; create a copy of install-tl.bat which exits with an exit code
+ Push $0
+ File /oname=${INST_TL_NAME}\inst_mod.bat ${INST_TL_NAME}\install-tl.bat
+ FileOpen $0 ${INST_TL_NAME}\inst_mod.bat a
+ FileSeek $0 0 END
+ FileWrite $0 "if errorlevel 1 (exit 1) else (exit 0)"
+ FileClose $0
+ Pop $0
+ DetailPrint "Starting the main installer:"
+ ${EndIf}
${If} $Radio_Value == "advanced"
- nsExec::Exec '"$INSTDIR\${INST_TL_NAME}\install-tl.bat" -gui perltk $REPO'
+ DetailPrint '"$INSTDIR\${INST_TL_NAME}\inst_mod.bat" -gui perltk $PARMS'
+ nsExec::ExecToLog '"$INSTDIR\${INST_TL_NAME}\inst_mod.bat" -gui perltk $PARMS'
+ Pop $0
${ElseIf} $Radio_Value == "simple"
- nsExec::Exec '"$INSTDIR\${INST_TL_NAME}\install-tl.bat" $REPO'
+ DetailPrint '"$INSTDIR\${INST_TL_NAME}\inst_mod.bat" $PARMS'
+ nsExec::ExecToLog '"$INSTDIR\${INST_TL_NAME}\inst_mod.bat" $PARMS'
+ Pop $0
+ ${EndIf}
+ ${If} $Radio_Value != "unpack"
+ ${If} $0 == "error"
+ MessageBox MB_ICONSTOP|MB_OK "Error; see details"
+ ${ElseIf} $0 == "timeout"
+ MessageBox MB_ICONSTOP|MB_OK "Timeout"
+ ${ElseIf} $0 <> 0
+ MessageBox MB_ICONSTOP|MB_OK "Error; for better info, unpack,$\r$\nthen run install.bat or install-advanced.bat."
+ ; ${Else}
+ ; MessageBox MB_ICONSTOP|MB_OK "No error"
+ ${EndIf}
${EndIf}
-
SectionEnd