diff options
-rwxr-xr-x | Master/install-tl.bat | 14 | ||||
-rw-r--r-- | Master/tlpkg/libexec/install-tl.nsi | 68 |
2 files changed, 50 insertions, 32 deletions
diff --git a/Master/install-tl.bat b/Master/install-tl.bat index 6b85ede22ce..6cffb14a535 100755 --- a/Master/install-tl.bat +++ b/Master/install-tl.bat @@ -15,7 +15,7 @@ if %~d0==\\ goto UNC rem Localize environment changes
setlocal enableextensions
-rem Do we really need to cd to the batch location?
+rem Do we really need to cd to the batch location? Yes.
cd /d "%~dp0"
rem Remove any double quotes from PATH (why we care for it at all???)
@@ -50,9 +50,10 @@ set PERL_UNICODE= rem Start installer
path
-perl "%~dpn0" %*
+echo "%~dp0install-tl" %*
+perl "%~dp0install-tl" %*
pause
-goto :eof
+goto :eoff
rem Subroutine to build search path without tex directories
rem any dir containing pdftex.exe is considered a tex dir
@@ -68,11 +69,6 @@ rem Add dir to path set "path=%path%;%~1"
goto :rebuildpath
-rem About install-tl.bat.manifest:
-rem Vista assumes that a file with install in the name is
-rem an installer and therefore requires administrative privileges.
-rem The manifest file tells Vista otherwise.
-
:UNC
echo Cannot run from UNC path.
echo Map network drive to a drive letter and rerun the installer.
@@ -84,3 +80,5 @@ exit /b 1 echo DOS and Windows 9x systems are not supported. Sorry.
echo Windows 2000 or newer is required.
pause
+
+:eoff
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 |