[svk-commit] r2430 - trunk/pkg/win32

nobody at bestpractical.com nobody at bestpractical.com
Sat Jul 14 05:02:01 EDT 2007


Author: clkao
Date: Sat Jul 14 05:01:27 2007
New Revision: 2430

Added:
   trunk/pkg/win32/builddist.bat   (contents, props changed)
   trunk/pkg/win32/paroptions.txt
   trunk/pkg/win32/setenv.bat   (contents, props changed)
Modified:
   trunk/pkg/win32/Path.nsh
   trunk/pkg/win32/svk.nsi

Log:
win32 build scripts update from klight.

Modified: trunk/pkg/win32/Path.nsh
==============================================================================
--- trunk/pkg/win32/Path.nsh	(original)
+++ trunk/pkg/win32/Path.nsh	Sat Jul 14 05:01:27 2007
@@ -1,3 +1,4 @@
+
 ;----------------------------------------
 ; based upon a script of "Written by KiCHiK 2003-01-18 05:57:02"
 ;----------------------------------------
@@ -68,7 +69,7 @@
       FileOpen $1 "$1\autoexec.bat" a
       FileSeek $1 0 END
       GetFullPathName /SHORT $0 $0
-      FileWrite $1 "$\r$\nSET PATH=$0;%PATH%$\r$\n"
+      FileWrite $1 "$\r$\nSET PATH=%PATH%;$0$\r$\n"
       FileClose $1
       Goto AddToPath_done
 
@@ -85,7 +86,7 @@
          ReadRegStr $1 ${NT_current_env} "PATH"
       read_path_NT_resume:
       StrCmp $1 "" AddToPath_NTdoIt
-         StrCpy $2 "$0;$1"
+         StrCpy $2 "$1;$0"
          Goto AddToPath_NTdoIt
       AddToPath_NTdoIt:
          StrCmp $4 "current" write_path_NT_current
@@ -116,6 +117,92 @@
 FunctionEnd
 
 ;====================================================
+; RemoveFromPath - Remove a given dir from the path
+;     Input: head of the stack
+;====================================================
+Function un.RemoveFromPath
+   Exch $0
+   Push $1
+   Push $2
+   Push $3
+   Push $4
+   
+   Call un.IsNT
+   Pop $1
+   StrCmp $1 1 unRemoveFromPath_NT
+      ; Not on NT
+      StrCpy $1 $WINDIR 2
+      FileOpen $1 "$1\autoexec.bat" r
+      GetTempFileName $4
+      FileOpen $2 $4 w
+      GetFullPathName /SHORT $0 $0
+      StrCpy $0 "SET PATH=%PATH%;$0"
+      SetRebootFlag true
+      Goto unRemoveFromPath_dosLoop
+     
+      unRemoveFromPath_dosLoop:
+         FileRead $1 $3
+         StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoop
+         StrCmp $3 "$0$\n" unRemoveFromPath_dosLoop
+         StrCmp $3 "$0" unRemoveFromPath_dosLoop
+         StrCmp $3 "" unRemoveFromPath_dosLoopEnd
+         FileWrite $2 $3
+         Goto unRemoveFromPath_dosLoop
+
+      unRemoveFromPath_dosLoopEnd:
+         FileClose $2
+         FileClose $1
+         StrCpy $1 $WINDIR 2
+         Delete "$1\autoexec.bat"
+         CopyFiles /SILENT $4 "$1\autoexec.bat"
+         Delete $4
+         Goto unRemoveFromPath_done
+ 
+   unRemoveFromPath_NT:
+      StrLen $2 $0
+      Call un.select_NT_profile
+      Pop  $4
+
+      StrCmp $4 "current" un_read_path_NT_current
+         ReadRegStr $1 ${NT_all_env} "PATH"
+         Goto un_read_path_NT_resume
+      un_read_path_NT_current:
+         ReadRegStr $1 ${NT_current_env} "PATH"
+      un_read_path_NT_resume:
+
+      Push $1
+      Push $0
+      Call un.StrStr ; Find $0 in $1
+      Pop $0 ; pos of our dir
+      IntCmp $0 -1 unRemoveFromPath_done
+         ; else, it is in path
+         StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
+         IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
+         IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
+         StrLen $0 $1
+         StrCpy $1 $1 $0 $2
+         StrCpy $3 "$3$1"
+
+         StrCmp $4 "current" un_write_path_NT_current
+            WriteRegExpandStr ${NT_all_env} "PATH" $3
+            Goto un_write_path_NT_resume
+         un_write_path_NT_current:
+            WriteRegExpandStr ${NT_current_env} "PATH" $3
+         un_write_path_NT_resume:
+         SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+   unRemoveFromPath_done:
+   Pop $4
+   Pop $3
+   Pop $2
+   Pop $1
+   Pop $0
+FunctionEnd
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Uninstall sutff
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;====================================================
 ; StrStr - Finds a given string in another given string.
 ;               Returns -1 if not found and the pos if found.
 ;          Input: head of the stack - string to find

Added: trunk/pkg/win32/builddist.bat
==============================================================================
--- (empty file)
+++ trunk/pkg/win32/builddist.bat	Sat Jul 14 05:01:27 2007
@@ -0,0 +1,89 @@
+REM This script builds a SVK installation package
+REM The environment (IE:system path) must be configured properly before
+REM    running this script! (see setenv.bat)
+REM After this script finishes, compile the NSIS script (svk.nsi) 
+REM    located in the build\win32\ folder.
+REM 
+REM This script requires:
+REM    That SVK be built
+REM    That pp is installed
+REM    That a zip/unzip program is available (Info-Zip)
+REM
+REM If mtee is available, a logfile can be created with a command line like:
+REM builddist 2>&1 | mtee /d/t log.txt
+REM
+REM Adjust the following to your needs!
+SET SVNHOME=C:/strawberry-perl/svn-win32-1.4.4
+SET SVKSOURCE=c:/strawberry-perl/src/SVK-v2.0.1
+SET PERLHOME=C:/strawberry-perl/perl
+SET PPSOURCESCRIPT=c:/strawberry-perl/src/SVK-v2.0.1/blib/script/SVK
+SET FIXZIP=c:\utils\zip -d build\SVK.par lib\SVK.
+SET UNZIPPER=c:\utils\unzip -o -d build build\SVK.par
+REM SET UNZIPPER="c:\program files\7-Zip\7z" x -y -obuild
+REM
+SET PAR_VERBATIM=1
+REM
+REM Remove and remnants of the previous build
+rd /s /q build
+
+REM create the working folders
+mkdir build
+
+REM Create a new set of path specific PAR (pp) options
+REM Copy the original parameter file to make run-time appends
+copy paroptions.txt parsvkfixups.txt
+REM This is done here because we cannot do variable subs in the parmater file
+REM do this to bring in the help pod's
+echo -a "%SVKSOURCE%/blib/lib/SVK/Help;lib/SVK/Help" >> parsvkfixups.txt
+REM # do this to bring in the I18N
+echo -a "%SVKSOURCE%/blib/lib/SVK/I18N;lib/SVK/I18N" >> parsvkfixups.txt
+REM # do this to fix the missing POSIX files
+echo -a "%PERLHOME%/lib/auto/POSIX;lib/auto/POSIX" >> parsvkfixups.txt
+REM Add the SVK source path to the build
+echo -I %SVKSOURCE%/blib/lib >> parsvkfixups.txt
+
+REM Move the built and Win32 specific files into the par
+echo -a "%PERLHOME%/bin/perl.exe;bin/perl.exe" >> parsvkfixups.txt
+echo -a "%PERLHOME%/bin/perl58.dll;bin/perl58.dll" >> parsvkfixups.txt
+echo -a "%PERLHOME%/bin/prove.bat;bin/prove.bat" >> parsvkfixups.txt
+echo -a "%SVNHOME%/bin/intl3_svn.dll;bin/intl3_svn.dll" >> parsvkfixups.txt
+echo -a "%SVNHOME%/bin/libapr.dll;bin/libapr.dll" >> parsvkfixups.txt
+echo -a "%SVNHOME%/bin/libapriconv.dll;bin/libapriconv.dll" >> parsvkfixups.txt
+echo -a "%SVNHOME%/bin/libaprutil.dll;bin/libaprutil.dll" >> parsvkfixups.txt
+echo -a "%SVNHOME%/bin/libdb44.dll;bin/libdb44.dll" >> parsvkfixups.txt
+echo -a "%SVNHOME%/bin/libeay32.dll;bin/libeay32.dll" >> parsvkfixups.txt
+echo -a "%SVNHOME%/bin/ssleay32.dll;bin/ssleay32.dll" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/blib/script/svk;bin/svk" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/blib/script/svk.bat;bin/svk.bat" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/pkg/win32/maketest.bat;win32/maketest.bat" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/pkg/win32/svk.ico;win32/svk.ico" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/pkg/win32/svk-uninstall.ico;win32/svk-uninstall.ico" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/pkg/win32/svk.nsi;win32/svk.nsi" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/pkg/win32/Path.nsh;win32/Path.nsh" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/contrib;site/contrib" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/utils;site/utils" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/t;site/t" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/README;README" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/CHANGES;CHANGES" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/ARTISTIC;ARTISTIC" >> parsvkfixups.txt
+echo -a "%SVKSOURCE%/COPYING;COPYING" >> parsvkfixups.txt
+
+REM using par, build the compressed output
+call pp @parsvkfixups.txt %PPSOURCESCRIPT%
+
+REM Must do a fixup before the .par can be un-packed
+REM Remove the lib\SVK. file as it conflicts with the lib\SVK folder on CIFS
+call %FIXZIP%
+REM extract the par THIS USES Info-Zip unzip but could use 7z.exe
+call %UNZIPPER% 
+
+REM remove the dynamicically created par options
+del /F/Q parsvkfixups.txt
+
+REM remove the .par after it is built
+del /F/Q build\SVK.par
+
+REM remove the script folder because we do not need it
+rd /S/Q build\script
+
+:exit

Added: trunk/pkg/win32/paroptions.txt
==============================================================================
--- (empty file)
+++ trunk/pkg/win32/paroptions.txt	Sat Jul 14 05:01:27 2007
@@ -0,0 +1,38 @@
+# ask for verboseness
+-vvv
+# don't build the .exe, stop at the par
+-o build/SVK.par 
+-B 
+-p
+# include the svk build library
+# NOTE: This is done on the pp command line
+#-I ../../blib/lib
+# add in the icon
+-i svk.ico
+# create a log
+-L pp.log
+# include some missed modules
+-M Encode::TW
+-M POSIX
+# exclude some not-needed dependencies
+-X ExtUtils::CBuilder
+-X LWP::Authen::Ntlm
+-X LWP::Protocol::GHTTP
+-X LWP::Protocol::mailto
+-X LWP::Protocol::https
+-X LWP::Protocol::https10
+-X Module::Build::Cookbook
+-X SVN::Mirror::VCP
+-X URI::urn::isbn
+-X Net::FTP
+-X CPAN
+-X Thread
+# The following actions are now done as a secondary option file to pp
+# See the builddist.bat file for details
+# do this to bring in the help pod's
+#-a "../../blib/lib/SVK/Help;lib/SVK/Help"
+# do this to bring in the I18N
+#-a "../../blib/lib/SVK/I18N;lib/SVK/I18N"
+# do this to fix the missing POSIX files
+#-a "../../../../perl/lib/auto/POSIX;lib/auto/POSIX"
+

Added: trunk/pkg/win32/setenv.bat
==============================================================================
--- (empty file)
+++ trunk/pkg/win32/setenv.bat	Sat Jul 14 05:01:27 2007
@@ -0,0 +1,10 @@
+REM Change the path to only include what is needed to build SVK
+REM Set the path to all of the Strawberry-Perl places
+set path=c:\strawberry-perl\perl\bin;c:\strawberry-perl\dmake\bin;c:\strawberry-perl\mingw\bin;c:\strawberry-perl\mingw\mingw32\bin
+REM Set the path to the location of cmd.exe (OS SPECIFIC!)
+set path=%path%;%WINDIR%\system32
+REM Set the location of the SVN binaries and dll's
+set path=%path%;C:\strawberry-perl\svn-win32-1.4.4\bin
+REM Finally set the mingw compiler include and lib locations
+set include=c:\strawberry-perl\mingw\include;
+set lib=c:\strawberry-perl\mingw\lib;
\ No newline at end of file

Modified: trunk/pkg/win32/svk.nsi
==============================================================================
--- trunk/pkg/win32/svk.nsi	(original)
+++ trunk/pkg/win32/svk.nsi	Sat Jul 14 05:01:27 2007
@@ -1,21 +1,23 @@
 SetCompressor bzip2
 
-!define MUI_COMPANY "OurInternet"
+!define MUI_COMPANY "Best Practical Solutions, LLC"
 !define MUI_PRODUCT "SVK"
-!define MUI_VERSION "0.26-1"
+!define MUI_VERSION "2.0.1-1"
 !define MUI_NAME    "svk"
 !define MUI_ICON "${MUI_NAME}.ico"
 !define MUI_UNICON "${MUI_NAME}-uninstall.ico"
 
 !include "MUI.nsh"
 !include "Path.nsh"
+!include "Library.nsh"
 
 XPStyle On
 Name "${MUI_PRODUCT}"
-OutFile "${MUI_NAME}-${MUI_VERSION}.exe"
-InstallDir "C:\Program Files\${MUI_NAME}"
+OutFile "..\${MUI_NAME}-${MUI_VERSION}.exe"
+InstallDir "$PROGRAMFILES\${MUI_NAME}"
 ShowInstDetails hide
 InstProgressFlags smooth
+Var ALREADY_INSTALLED
 
   !define MUI_ABORTWARNING
 
@@ -35,10 +37,9 @@
 		"SOFTWARE\${MUI_COMPANY}\${MUI_PRODUCT}" "" "$INSTDIR"
     SetOverwrite on
     SetOutPath $INSTDIR
-    File /r ..\svk.bat
     File /r ..\bin
     File /r ..\lib
-    File /r ..\site
+    File /r /x checkout ..\site
     File /r ..\win32
 
     Delete "$INSTDIR\svk.bat"
@@ -47,15 +48,22 @@
     FileOpen $1 "$INSTDIR\bin\svk.bat" w
     FileWrite $1 "@echo off$\n"
     FileWrite $1 "if $\"%OS%$\" == $\"Windows_NT$\" goto WinNT$\n"
-    FileWrite $1 "$\"$INSTDIR\bin\perl.exe$\" $\"$INSTDIR\site\bin\svk$\" %1 %2 %3 %4 %5 %6 %7 %8 %9$\n"
+    FileWrite $1 "$\"$INSTDIR\bin\perl.exe$\" $\"$INSTDIR\bin\svk$\" %1 %2 %3 %4 %5 %6 %7 %8 %9$\n"
     FileWrite $1 "goto endofsvk$\n"
     FileWrite $1 ":WinNT$\n"
-    FileWrite $1 "$\"%~dp0perl.exe$\" $\"%~dp0..\site\bin\svk$\" %*$\n"
-    FileWrite $1 ":endofsvk\n"
+    FileWrite $1 "$\"%~dp0perl.exe$\" $\"%~dp0svk$\" %*$\n"
+    FileWrite $1 "if NOT $\"%COMSPEC%$\" == $\"%SystemRoot%\system32\cmd.exe$\" goto endofperl$\n"
+    FileWrite $1 "if %errorlevel% == 9009 echo You do not have Perl in your PATH.$\n"
+    FileWrite $1 "if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul$\n"
+    FileWrite $1 ":endofperl$\n"
     FileClose $1
 
     WriteUninstaller "$INSTDIR\Uninstall.exe"
 
+new_installation:
+
+	!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "shared\msvcr71.dll" "$SYSDIR\msvcr71.dll" $SYSDIR
+
 Libeay32:
     IfFileExists "$SYSDIR\libeay32.dll" RenameLibeay32 SSLeay32
 RenameLibeay32:
@@ -66,6 +74,7 @@
 RenameSSLeay32:
     Rename "$SYSDIR\ssleay32.dll" "$SYSDIR\ssleay32.dll.old"
 
+
 Done:
     ; Add \bin directory to the PATH for svk.bat and DLLs
     Push "$INSTDIR\bin"


More information about the svk-commit mailing list