Skip to content

Commit

Permalink
change nsis version
Browse files Browse the repository at this point in the history
  • Loading branch information
lapoigne committed Aug 16, 2018
1 parent 8a764ae commit 7a3333b
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Borg-installer
CygWin
nsis-2*
nsis-*
!nsis-installer.nsi
http*
ftp*
*.exe
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

#### 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

---

#### 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


Expand All @@ -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.
10 changes: 2 additions & 8 deletions build-cygwin.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
exit
27 changes: 23 additions & 4 deletions build-installer.bat
Original file line number Diff line number Diff line change
@@ -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 <ExtractTo> <newzipfile>
set vbs="%temp%\_.vbs"
Expand All @@ -36,4 +50,9 @@ exit /b
:ERROR
echo Error missing %NSISV%.zip in folder
pause
exit /b
exit

:CPUERROR
echo Error missing firt argument "x86" or "x86_64"
pause
exit
3 changes: 2 additions & 1 deletion build32.bat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build-cygwin.bat setup-x86.exe
CALL build-cygwin.bat setup-x86.exe
CALL build-installer.bat x86
3 changes: 2 additions & 1 deletion build64.bat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build-cygwin.bat setup-x86_64.exe
CALL build-cygwin.bat setup-x86_64.exe
CALL build-installer.bat x86_64
26 changes: 13 additions & 13 deletions nsis-installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; Billy Charlton <[email protected]>
; --------------------------

!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"
Expand All @@ -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 "."
Expand All @@ -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"
Expand All @@ -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"


;--------------------------------
Expand Down

0 comments on commit 7a3333b

Please sign in to comment.