[rkward-cvs] SF.net SVN: rkward-code:[4828] trunk/rkward/windows_nsis

tfry at users.sf.net tfry at users.sf.net
Tue Sep 16 18:40:55 UTC 2014


Revision: 4828
          http://sourceforge.net/p/rkward/code/4828
Author:   tfry
Date:     2014-09-16 18:40:53 +0000 (Tue, 16 Sep 2014)
Log Message:
-----------
Fixes and updates to release script, and installer.

Modified Paths:
--------------
    trunk/rkward/windows_nsis/installer.nsi
    trunk/rkward/windows_nsis/make_release.bat

Modified: trunk/rkward/windows_nsis/installer.nsi
===================================================================
--- trunk/rkward/windows_nsis/installer.nsi	2014-09-16 17:47:58 UTC (rev 4827)
+++ trunk/rkward/windows_nsis/installer.nsi	2014-09-16 18:40:53 UTC (rev 4828)
@@ -42,6 +42,74 @@
 Page custom KDEHomeCreate KDEHomeLeave
 Page instfiles
 
+# StrRep function. Taken from http://nsis.sf.net/StrRep
+!define StrRep "!insertmacro StrRep"
+!macro StrRep output string old new
+    Push `${string}`
+    Push `${old}`
+    Push `${new}`
+    !ifdef __UNINSTALL__
+        Call un.StrRep
+    !else
+        Call StrRep
+    !endif
+    Pop ${output}
+!macroend
+ 
+!macro Func_StrRep un
+    Function ${un}StrRep
+        Exch $R2 ;new
+        Exch 1
+        Exch $R1 ;old
+        Exch 2
+        Exch $R0 ;string
+        Push $R3
+        Push $R4
+        Push $R5
+        Push $R6
+        Push $R7
+        Push $R8
+        Push $R9
+ 
+        StrCpy $R3 0
+        StrLen $R4 $R1
+        StrLen $R6 $R0
+        StrLen $R9 $R2
+        loop:
+            StrCpy $R5 $R0 $R4 $R3
+            StrCmp $R5 $R1 found
+            StrCmp $R3 $R6 done
+            IntOp $R3 $R3 + 1 ;move offset by 1 to check the next character
+            Goto loop
+        found:
+            StrCpy $R5 $R0 $R3
+            IntOp $R8 $R3 + $R4
+            StrCpy $R7 $R0 "" $R8
+            StrCpy $R0 $R5$R2$R7
+            StrLen $R6 $R0
+            IntOp $R3 $R3 + $R9 ;move offset by length of the replacement string
+            Goto loop
+        done:
+ 
+        Pop $R9
+        Pop $R8
+        Pop $R7
+        Pop $R6
+        Pop $R5
+        Pop $R4
+        Pop $R3
+        Push $R0
+        Push $R1
+        Pop $R0
+        Pop $R1
+        Pop $R0
+        Pop $R2
+        Exch $R1
+    FunctionEnd
+!macroend
+!insertmacro Func_StrRep ""
+!insertmacro Func_StrRep "un."
+
 !macro MakeExternalLink Py Plabel Plink
 	Push $0 ; save $0
 
@@ -121,8 +189,8 @@
 		IntOp $R3 $R0 & 0x0000FFFF
 		StrCpy $1 "Version $R2.$R3"
 
-		# 0x00020005a == Version 2.9(.)0
-		${If} $R0 >= 0x0002005a
+		# 0x000300000 == Version 3.0(.)0 (if think)
+		${If} $R0 >= 0x00030000
 			StrCpy $2 "should be ok"
 			IntOp $RHomeOk_count $RHomeOk_count + 1
 		${Else}
@@ -238,7 +306,7 @@
 	libktexteditor_dll_found:
 		StrCpy $1 "$Libktexteditor_dll_location exists"
 
-		!insertmacro RunSimpleQuery "$FileSelectCurrent\bin\kde4-config.exe --kde-version" "UNKNOWN"
+		!insertmacro RunSimpleQuery "$\"$FileSelectCurrent\bin\kde4-config.exe$\" --kde-version" "UNKNOWN"
 		Pop $INST_KDE_VERSION
 
 		!insertmacro VersionCompareCall $INST_KDE_VERSION "4.7.0" $MyTemp
@@ -293,11 +361,6 @@
 
 ## installation
 
-Function setRBinaryPath
-	StrCpy $R9 "SET R_BINARY=$INST_RHOME\bin\R.exe$\r$\n"
-	Push $0
-FunctionEnd
-
 # set desktop as install directory
 installDir $DESKTOP
 
@@ -305,7 +368,10 @@
 section
 	setOutPath $INST_KDEPREFIX
 	File /r install\_KDEPREFIX_\*.*
-	${LineFind} "$INST_KDEPREFIX\bin\rkward.bat" "" 10 setRBinaryPath
+	FileOpen $4 "$INST_KDEPREFIX\bin\rkward.ini" w
+	${StrRep} $5 "R executable=$INST_RHOME\bin\R.exe$\r$\n" "\" "\\"
+	FileWrite $4 $5
+	FileClose $4
 
 	setOutPath $INST_RHOME
 	File /r install\_RHOME_\*.*

Modified: trunk/rkward/windows_nsis/make_release.bat
===================================================================
--- trunk/rkward/windows_nsis/make_release.bat	2014-09-16 17:47:58 UTC (rev 4827)
+++ trunk/rkward/windows_nsis/make_release.bat	2014-09-16 18:40:53 UTC (rev 4828)
@@ -1,11 +1,10 @@
 SET KDEPREFIXDRIVE=c:
 SET KDEPREFIX=KDE
-SET RHOMEDRIVE=C:
-SET RHOME=Programme/R/R-2.15.1
+SET RHOMEDRIVE=K:
+SET RHOME=K/lib/R
 
-SET SH_PATH=C:\Rtools\bin
-SET MINGW_PATH=C:\Mingw\bin
-SET MAKENSIS=c:/programme/nsis/makensis.exe
+SET MINGW_PATH=K:\K\mingw\bin
+SET MAKENSIS=c:\program files/nsis/makensis.exe
 
 REM --------------------------------------------
 REM everything below should not need customizing
@@ -23,17 +22,17 @@
 mkdir install
 mkdir build
 cd build
+del CMakeCache.txt
 cmake %SOURCE_DIR% -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=%KDEPREFIXDRIVE%/%KDEPREFIX% -DR_EXECUTABLE=%RHOMEDRIVE%/%RHOME%/bin/R.exe -DR_LIBDIR=%RHOMEDRIVE%/%RHOME%/library %ADD_CMAKE_FLAGS%
-REM sh.exe must not be in path during cmake call, but must be in path for R package install...
-SET PATH=%PATH%;%SH_PATH%
 mingw32-make install DESTDIR=%INSTALL_DIR%
 IF %ERRORLEVEL% NEQ 0 GOTO ERROR
 
-move %INSTALL_DIR%/%RHOME% %INSTALL_DIR%/_RHOME_
+cd %INSTALL_DIR%
+move %RHOME% _RHOME_
 IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-move %INSTALL_DIR%/%KDEPREFIX% %INSTALL_DIR%/_KDEPREFIX_
+move %KDEPREFIX% _KDEPREFIX_
 IF %ERRORLEVEL% NEQ 0 GOTO ERROR
-copy /Y %MINGW_PATH%\libgcc_s_dw2-1.dll %RELEASE_DIR%\install\_KDEPREFIX_\bin\
+copy /Y %MINGW_PATH%\libgcc_s*.dll %RELEASE_DIR%\install\_KDEPREFIX_\bin\
 IF %ERRORLEVEL% NEQ 0 GOTO ERROR
 
 REM Prepare Version info for use in NSIS





More information about the rkward-tracker mailing list