Skip to content

csiro-hydroinformatics/sf-installer

Repository files navigation

sf-installer

Source code of the WiX installer to build a Windows installer for the Streamflow Forecasting software stack

Build with WiX 4

A blog post Windows installer with WiX 4 - part 1 is a related if idiosyncratic tutorial on using WiX 4.

This installer source code is public for possible didactic use by others, but the instructions below are not designed as a tutorial or as a readily reusable template.

Prerequisites

Note: see also C:\src\cruise-control\doc\build_pipelines.md which has partial duplicates

set build_out_dir=X:\work\common\Software\sf\install
set src_libs_dir=%build_out_dir%\core\windows

if not defined local_dir set local_dir=c:\local
set libs64_dir=%local_dir%\libs\64
if not exist %libs64_dir% mkdir %libs64_dir%
if not exist %local_dir%\matlab mkdir %local_dir%\matlab
if not exist %local_dir%\python mkdir %local_dir%\python

set robocopy_opt=/MIR /MT:1 /R:2 /NJS /NJH /NFL /NDL /XX
set COPYOPTIONS=/Y /R /D

REM cd %libs64_dir%
REM del /Q *.*

:: You may replace 7z with the full path, typically "c:\Program Files\7-Zip\7z.exe" with quotation marks
7z x -y -o%local_dir% %src_libs_dir%\libs.7z

set robocopy_opt=/MIR /MT:1 /R:2 /NJS /NJH /NFL /NDL /XX
set COPYOPTIONS=/Y /R /D

REM may need to adjust the source directory for matlab below!
robocopy %build_out_dir%\matlab\matlab\ %local_dir%\matlab  %robocopy_opt%

robocopy %build_out_dir%\R\ %local_dir%\ %robocopy_opt%


cd %local_dir%\python
del /Q *.whl

xcopy %build_out_dir%\python\*.whl %local_dir%\python  %COPYOPTIONS%

Building the installer

In a VS development prompt:

set TestCertificate="h:\credentials\CSIRO.pfx"
set TestPassword=xyxyxyxyxyxyxyxyxynotreallythat

set SRC_DIR=C:\src\sf-installer
cd %SRC_DIR%

:: 2023-11-15
:: CAUTION: no trailing spaces in version num... Silly dos.
set VERSION_NUM=1.2.0
REM May 2024
set VERSION_NUM=1.3.0
msbuild -nologo -p:Configuration=Release -p:Platform=x64 -p:BuildVersion=%VERSION_NUM% sf.wixproj
REM msbuild -nologo -m BeltTest\BeltTest.sln -p:BuildVersion=0.35

set wininstall_dir=X:\work\common\Software\sf\install\windows_installer
if not exist %wininstall_dir% mkdir %wininstall_dir%
set COPYOPTIONS=/Y /R /D

set BUILD_DIR=%SRC_DIR%\bin\x64\Release
dir %BUILD_DIR%
cd %BUILD_DIR%
del sf-*.msi
xcopy sf.msi sf-%VERSION_NUM%.msi
xcopy %BUILD_DIR%\sf-%VERSION_NUM%.msi %wininstall_dir%\  %COPYOPTIONS%
xcopy %BUILD_DIR%\sf.wixpdb %wininstall_dir%\  %COPYOPTIONS%

Appendix

To update WiX:

dotnet tool update --global wix

About

No description, website, or topics provided.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license.rtf

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published