diff --git a/.gitignore b/.gitignore index 6a8f251..ff713a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ Borg-installer CygWin -nsis-2* +nsis-* +!nsis-installer.nsi http* ftp* *.exe \ No newline at end of file diff --git a/README.md b/README.md index 8fd1911..29fac90 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ #### This creates a standard Windows installer for Borg Backup on Windows 7 and above. -* The only prerequisite is the presence of NSIS zip, available at [https://sourceforge.net/projects/nsis/files/NSIS%202/2.51/nsis-2.51.zip/download](https://sourceforge.net/projects/nsis/files/NSIS%202/2.51/nsis-2.51.zip/download) +* The only prerequisite is the presence of NSIS zip, available at [https://sourceforge.net/projects/nsis/files/NSIS%203/3.03/nsis-3.03.zip/download](https://sourceforge.net/projects/nsis/files/NSIS%203/3.03/nsis-3.03.zip/download) * About 1 GB free disk space required to build installer * Borg install itself will only require about 165 MB @@ -10,7 +10,7 @@ #### What doesn't work: -* borg mount command : it use FUSE wich is not available on Windows. +* `borg mount` command : it use FUSE wich is not available on Windows. * ssh repo like `borg init user@host:repo`; you need to mount the repo as networkdrive first with [WinFsp](http://www.secfs.net/winfsp/) for exemple @@ -27,4 +27,4 @@ borg create -C lz4 /d/Borg::Test /c/Photos/ The install script first builds borg inside temporary CygWin subfolder, then installs a much smaller release version into the Borg-installer subfolder. Built packages are copied over, unnecessary files removed, and then NSIS is run. -Tested with CygWin 2.10.0, borgbackup 1.1.6 on Windows 7 32-bit & 64-bit. +Tested with CygWin 2.10.0, borgbackup 1.1.7 on Windows 7 32-bit & 64-bit. diff --git a/build-cygwin.bat b/build-cygwin.bat index f384f73..7de5883 100644 --- a/build-cygwin.bat +++ b/build-cygwin.bat @@ -81,17 +81,11 @@ del /s /q %CYGPATH%\*.h del /s /q %CYGPATH%\var\log del /s /q %CYGPATH%\var\cache -REM --- Build Installer using NSIS - cd %OURPATH% -build-installer.bat - -GOTO END +goto :EOF :ERROR echo Don't launch this script use build32.bat or build64.bat instead pause - -:END -exit /b \ No newline at end of file +exit \ No newline at end of file diff --git a/build-installer.bat b/build-installer.bat index 785a422..32e5069 100644 --- a/build-installer.bat +++ b/build-installer.bat @@ -1,21 +1,35 @@ @echo off setlocal +REM --- Need cpu version at first parameter +if "%~1"=="" GOTO CPUERROR + REM --- NSIS zip must be in folder! Get NSIS from http://nsis.sourceforge.net/Download +REM https://sourceforge.net/projects/nsis/files/NSIS%203/3.03/nsis-3.03.zip/download REM --- NSIS version -set NSISV=nsis-2.51 +set NSISV=nsis-3.03 set OURPATH=%cd% +set CYGPATH=%OURPATH%\Borg-installer set MAKENSIS="%OURPATH%\%NSISV%\makensis.exe" IF NOT EXIST "%OURPATH%\%NSISV%.zip" GOTO ERROR IF NOT EXIST "%OURPATH%\%NSISV%" Call :UnZipFile "%OURPATH%" "%OURPATH%\%NSISV%.zip" -%MAKENSIS% nsis-installer.nsi +REM --- Automatic Borg version check +REM --- Can't use pipe directly in command, workaround with temp file +cd %CYGPATH% +bin\bash --login -c 'borg -V' > borg-version +bin\bash --login -c 'cut -d " " -f 2 /borg-version' +FOR /F "tokens=*" %%a in ('bin\bash --login -c 'cut -d " " -f 2 /borg-version'') do SET BVERSION=%%a +bin\bash --login -c 'rm /borg-version' +cd %OURPATH% -exit /b +%MAKENSIS% /DARCH=%1 /DVERSION=%BVERSION% /V4 nsis-installer.nsi + +goto :EOF :UnZipFile set vbs="%temp%\_.vbs" @@ -36,4 +50,9 @@ exit /b :ERROR echo Error missing %NSISV%.zip in folder pause -exit /b \ No newline at end of file +exit + +:CPUERROR +echo Error missing firt argument "x86" or "x86_64" +pause +exit \ No newline at end of file diff --git a/build32.bat b/build32.bat index 5cf147c..25213d4 100644 --- a/build32.bat +++ b/build32.bat @@ -1 +1,2 @@ -build-cygwin.bat setup-x86.exe \ No newline at end of file +CALL build-cygwin.bat setup-x86.exe +CALL build-installer.bat x86 \ No newline at end of file diff --git a/build64.bat b/build64.bat index 49a4f6d..6288731 100644 --- a/build64.bat +++ b/build64.bat @@ -1 +1,2 @@ -build-cygwin.bat setup-x86_64.exe \ No newline at end of file +CALL build-cygwin.bat setup-x86_64.exe +CALL build-installer.bat x86_64 \ No newline at end of file diff --git a/nsis-installer.nsi b/nsis-installer.nsi index e5b9f8c..7738330 100644 --- a/nsis-installer.nsi +++ b/nsis-installer.nsi @@ -2,7 +2,7 @@ ; Billy Charlton ; -------------------------- -!define VERSION "1.1.6" +;!define VERSION "1.1.7" !define VERSION_LONG "${VERSION}.0" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\BorgBackupUnofficial" @@ -11,8 +11,16 @@ ; use "Modern" UI ;!define MUI_ICON "console.ico" !include "MUI2.nsh" -!insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +; Pages !define MUI_PAGE_HEADER_TEXT "Borg Backup" +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_LANGUAGE "English" !addincludedir "." !addplugindir "." @@ -21,7 +29,7 @@ Name "Borg Backup ${VERSION}" ; The file to write -OutFile "Borg Backup Installer v${VERSION}.exe" +OutFile "Borg Backup Installer v${VERSION}_${ARCH}.exe" ; The default installation directory InstallDir "$PROGRAMFILES64\Borg" @@ -36,16 +44,8 @@ RequestExecutionLevel admin VIProductVersion "${VERSION_LONG}" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "BorgBackupUnofficial" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VERSION_LONG}" - -;-------------------------------- - -; Pages - -!insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_COMPONENTS -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES +VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "" +VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Borg Backup Unofficial installer" ;--------------------------------