diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2013-03-17 11:08:26 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2013-03-17 11:08:26 +0000 |
commit | bc7a082251edbbc65fdb15588c12122734871480 (patch) | |
tree | 2ddf4fc7b7c4a8a6de0d8b4c1e01afdb68975c9a /Master | |
parent | a8b46138cf370976adc2d2fa409a13cc29511b29 (diff) |
revised w32 nsis installer
git-svn-id: svn://tug.org/texlive/trunk@29407 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/bin/install-tl.nsi | 177 | ||||
-rw-r--r-- | Master/tlpkg/bin/isadmin_q.cmd | 34 | ||||
-rw-r--r-- | Master/tlpkg/bin/tl-update-install-pkg.pat | 46 |
3 files changed, 166 insertions, 91 deletions
diff --git a/Master/tlpkg/bin/install-tl.nsi b/Master/tlpkg/bin/install-tl.nsi index 5bf3f6df5ee..d03b4330f37 100644 --- a/Master/tlpkg/bin/install-tl.nsi +++ b/Master/tlpkg/bin/install-tl.nsi @@ -18,101 +18,102 @@ !include tlsubdir.nsh ; generated by tl-update-install-pkg Name "TeX Live Installer ${YYYYMMDD}" -OutFile ${INST_TL_NAME}.exe +OutFile install-tl.exe -; ShowInstDetails show +Caption "TeX Live installer" +SubCaption 2 ": Unpack directory" +SubCaption 4 ": Unpacking..." -RequestExecutionLevel highest +XPStyle on +RequestExecutionLevel user SetCompressor /SOLID bzip2 -; Controls +; Controls: installation type Var Dialog Var Label Var RadioSimple Var RadioAdvanced Var RadioUnpack -; values +; Controls: confirmation page +Var Confirm +Var Explain + +; values for installation type Var Radio_Value Var Radio_Default Var Radio_Temp -Var Is_Admin Var Admin_warning Var Completed_text CompletedText $Completed_text +Var InstOrUnpack +;Var NextOrUnpack +;MiscButtonText "" $NextOrUnpack "" "" +InstallButtonText $InstOrUnpack ; for local testing: Var REPO -ReserveFile isadmin_q.cmd - Page custom tlOptionsPage tlOptionsPageLeave -Page directory dirPre +Page directory dirPre "" dirLeave +Page custom ConfirmPage ConfirmLeave Page instfiles -Function dirPre - - ${If} $Radio_Value != "unpack" - Abort - ${EndIf} - -FunctionEnd - -DirText "Directory to unpack the TeX Live installer.$\nClick Install to start unpacking." - Function .onInit ${If} ${AtMostWin2000} - MessageBox MB_OK|MB_ICONSTOP "Windows XP earliest supported version; aborting..." + MessageBox MB_OK|MB_ICONSTOP \ + "Windows XP earliest supported version; aborting..." Abort ${EndIf} InitPluginsDir StrCpy $INSTDIR $PLUGINSDIR - File /oname=$PLUGINSDIR\isadmin_q.cmd "isadmin_q.cmd" - nsExec::ExecToStack '"cmd" /c "$PLUGINSDIR\isadmin_q.cmd"' + UserInfo::GetAccountType Pop $0 - - ${If} $0 == 0 ; Admin permissions - Push 1 - Pop $Is_Admin + ${If} $0 == "Admin" StrCpy $Admin_warning "" - #StrCpy $License_button "Continue" ${Else} ; failure or no admin permissions - Push 0 - Pop $Is_Admin - StrCpy $Admin_warning "Only single-user install possible.$\r$\nFor an all-users installation, abort now and re-run as administrator." + StrCpy $Admin_warning "Only single-user install possible.$\r$\nFor an all-users installation, abort now and re-run as administrator.$\r$\n" ${EndIf} StrCpy $Radio_Default "simple" StrCpy $Radio_Value $Radio_Default - StrCpy $Completed_text "Completed" + ;StrCpy $NextOrUnpack "Next" FunctionEnd -Function Value_to_States +Function dirPre - ${NSD_Uncheck} $RadioSimple - ${NSD_Uncheck} $RadioAdvanced - ${NSD_Uncheck} $RadioUnpack - ${NSD_GetUserData} $RadioSimple $Radio_Temp - ${If} $Radio_Temp == $Radio_Value - ${NSD_Check} $RadioSimple - ${EndIf} - ${NSD_GetUserData} $RadioAdvanced $Radio_Temp - ${If} $Radio_Temp == $Radio_Value - ${NSD_Check} $RadioAdvanced + ${If} $Radio_Value != "unpack" + Abort ${EndIf} - ${NSD_GetUserData} $RadioUnpack $Radio_Temp - ${If} $Radio_Temp == $Radio_Value - ${NSD_Check} $RadioUnpack + +FunctionEnd + +Function dirLeave + + Push $0 + + ${DirState} "$INSTDIR\${INST_TL_NAME}" $0 + ${If} $0 == 1 + MessageBox MB_YESNO \ + "OK to replace contents of $INSTDIR\${INST_TL_NAME}?" \ + IDYES continue + Abort + continue: + RMDir /r "$INSTDIR\${INST_TL_NAME}" ${EndIf} + Pop $0 + FunctionEnd +DirText "Directory to unpack the TeX Live installer" + Function tlOptionsPage nsDialogs::Create 1018 @@ -152,8 +153,35 @@ Function tlOptionsPageLeave Call Value_to_States ${If} $Radio_Value == "unpack" - StrCpy $INSTDIR $TEMP - StrCpy $Completed_text "Done unpacking; run install-tl.bat or install-tl-advanced.bat" + StrCpy $INSTDIR "$DESKTOP" + StrCpy $Completed_text \ + "Done; next run install-tl.bat or install-tl-advanced.bat." + StrCpy $InstOrUnpack "Unpack" + ;StrCpy $NextOrUnpack "Next" + ${Else} + StrCpy $Completed_text "Completed" + StrCpy $InstOrUnpack "Install" + ;StrCpy $NextOrUnpack "Unpack" + ${EndIf} + +FunctionEnd + +Function Value_to_States + + ${NSD_Uncheck} $RadioSimple + ${NSD_Uncheck} $RadioAdvanced + ${NSD_Uncheck} $RadioUnpack + ${NSD_GetUserData} $RadioSimple $Radio_Temp + ${If} $Radio_Temp == $Radio_Value + ${NSD_Check} $RadioSimple + ${EndIf} + ${NSD_GetUserData} $RadioAdvanced $Radio_Temp + ${If} $Radio_Temp == $Radio_Value + ${NSD_Check} $RadioAdvanced + ${EndIf} + ${NSD_GetUserData} $RadioUnpack $Radio_Temp + ${If} $Radio_Temp == $Radio_Value + ${NSD_Check} $RadioUnpack ${EndIf} FunctionEnd @@ -165,14 +193,51 @@ Function UpdateRadio FunctionEnd +Function ConfirmPage + + ;${If} $Radio_Value == "unpack" + ; Abort + ;${EndIf} + + nsDialogs::Create 1018 + Pop $Confirm + + ${If} $Confirm == error + Abort + ${EndIf} + + ${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." + ${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..." + ${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..." + ${EndIf} + Pop $Explain + + nsDialogs::Show + +FunctionEnd + +Function ConfirmLeave + +FunctionEnd + Section ${GetParameters} $REPO ${If} $REPO != "" StrCpy $REPO "-repository $REPO" ${EndIf} + ; for local testing: + ; StrCpy $REPO "-repository U:\systems\texlive\tlnet" + ; StrCpy $REPO "-repository D:\tlnet" + ; Detailprint $Radio_Value - DetailPrint '-- $REPO --' + ; DetailPrint '-- $REPO --' ${If} $Radio_Value == "unpack" SetOutPath $INSTDIR ${Else} @@ -180,14 +245,18 @@ Section ; automatically cleared afterwards SetOutPath $PLUGINSDIR ${EndIf} - File /r ${INST_TL_NAME}\*.* - ; File ${INST_TL_NAME}\install-tl* + + 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 + ${If} $Radio_Value == "advanced" - nsExec::Exec '"$INSTDIR\install-tl.bat" -gui perltk $REPO' - ; ExecWait '"$INSTDIR\install-tl.bat" -gui perltk $REPO' + nsExec::Exec '"$INSTDIR\${INST_TL_NAME}\install-tl.bat" -gui perltk $REPO' ${ElseIf} $Radio_Value == "simple" - nsExec::Exec '"$INSTDIR\install-tl.bat" $REPO' - ; ExecWait '"$INSTDIR\install-tl.bat" $REPO' + nsExec::Exec '"$INSTDIR\${INST_TL_NAME}\install-tl.bat" $REPO' ${EndIf} SectionEnd diff --git a/Master/tlpkg/bin/isadmin_q.cmd b/Master/tlpkg/bin/isadmin_q.cmd deleted file mode 100644 index 22333e525fe..00000000000 --- a/Master/tlpkg/bin/isadmin_q.cmd +++ /dev/null @@ -1,34 +0,0 @@ -@echo off -setlocal enableextensions - -for /f "tokens=3" %%a in ('reg query "HKLM\software\microsoft\windows nt\currentversion" /v currentversion ^| findstr "REG_SZ"') do set ver=%%a - -rem echo %ver% - -rem The caller already tests for >=xp -rem if %ver% leq 5.0 echo too old -rem if %ver% leq 5.0 exit /b - -set el=1 -if %ver% geq 6.0 ( - rem echo vista test - for /f "usebackq delims=, tokens=3" %%a in (`whoami /groups /fo csv`) do ( - rem The second item is "type", hopefully without commas, - rem otherwise the parsing would break. - rem What comes after the 3rd token is irrelevant. - rem Alternatively, search the entire string for the sid with findstr. - rem echo %%a - if /i %%a=="S-1-16-12288" ( - set el=0 - ) - ) -) else ( - for /f "usebackq delims= skip=4" %%a in (`net localgroup Administrators`) do ( - if /i "%%a"=="%username%" ( - set el=0 - ) - ) -) -exit %el% - -endlocal diff --git a/Master/tlpkg/bin/tl-update-install-pkg.pat b/Master/tlpkg/bin/tl-update-install-pkg.pat index 54d92dd09cb..f2033d689a4 100644 --- a/Master/tlpkg/bin/tl-update-install-pkg.pat +++ b/Master/tlpkg/bin/tl-update-install-pkg.pat @@ -1,5 +1,5 @@ *** tl-update-install-pkg 2009-10-10 01:54:07.000000000 +0200 ---- tl-update-install-pkg-new 2013-03-13 18:33:44.000000000 +0100 +--- tl-update-install-pkg-new 2013-03-17 11:23:31.000000000 +0100 *************** *** 1,7 **** #!/usr/bin/env perl @@ -46,7 +46,7 @@ *************** *** 205,210 **** ---- 206,218 ---- +--- 206,217 ---- chdir ($tmpdir) || die "chdir($tmpdir) failed: $!"; if ($type eq 'zip') { system ('zip', '-rq', 'install-tl.zip', $install_tl_name); @@ -55,8 +55,48 @@ + system ("echo !define YYYYMMDD '$YYYYMMDD' >\"$tmpdir/tlsubdir.nsh\""); + system ("echo !define INST_TL_NAME '$install_tl_name' >>\"$tmpdir/tlsubdir.nsh\""); + copy ("$::installerdir/tlpkg/bin/install-tl.nsi", $tmpdir); -+ copy ("$::installerdir/tlpkg/bin/isadmin_q.cmd", $tmpdir); + system ('makensis', 'install-tl'); } else { system ('tar', '-czf', 'install-tl-unx.tar.gz', $install_tl_name); } +*************** +*** 212,228 **** + } + + +! # copy generated zip+tgz to outputdir, + # + sub install_files + { + $outputdir = abs_path ($outputdir); + info ("$0: Installing to $outputdir\n"); +! for my $f ("install-tl-unx.tar.gz", "install-tl.zip") { + copy ("$tmpdir/$f", $outputdir); + system ("cd $outputdir && sha256sum $f >$f.sha256"); + system ('ls', '-l', "$outputdir/$f"); + } + + # create unpacked installer that can run in that directory, + # for the sake of people mirroring. +--- 219,239 ---- + } + + +! # copy generated zip+tgz+nsi to outputdir, + # + sub install_files + { + $outputdir = abs_path ($outputdir); + info ("$0: Installing to $outputdir\n"); +! for my $f ("install-tl-unx.tar.gz", "install-tl.zip", "install-tl.exe") { + copy ("$tmpdir/$f", $outputdir); + system ("cd $outputdir && sha256sum $f >$f.sha256"); + system ('ls', '-l', "$outputdir/$f"); + } ++ for my $e ('', '.sha256') { ++ rename ("$outputdir/install-tl.exe$e", ++ "$outputdir/install-tl-experimental.exe$e"); ++ } + + # create unpacked installer that can run in that directory, + # for the sake of people mirroring. |