OpenModelica Windows installer based on NSIS.
- NSIS 3.0.4
- Copy
AccessControl.dll(checked into this repo) into your NSIS Unicode plugin directory, e.g. intoC:\Program Files (x86)\NSIS\Plugins\x86-unicode.
- Copy
- git
- OMDev
- (optional) SignTool, part of Microsoft Windows Software Development Kit.
You'll need to export all tools to PATH environment variable in your MSYS2 UCRT64 shell
%OMDEV%\tools\msys\ucrt64.exe:
export PATH=$PATH:/c/Program\ Files/Git/bin
export PATH=$PATH:/c/Program\ Files\ \(x86\)/NSIS/BinAlso make sure to set environment variables
OMDEV, e.g.c:\\OMDevOPENMODELICAHOME, e.g.d:\\path\\to\\OpenModelica\\build_cmake\\install_cmakeOPENMODELICALIBRARY, e.g.d:\\path\\to\\OpenModelica\\build_cmake\\install_cmake\\lib\\omlibrary
with Windows style paths using \.
Build:
- OpenModelica
- OpenModelica libraries
- OMPython
- OMSimulator
- OMSens
Download the HTML and PDF versions of OpenModelica User's Guide:
cd ${OPENMODELICAHOME}/share/doc/omc
wget --no-check-certificate https://openmodelica.org/doc/openmodelica-doc-latest.tar.xz
tar -xJf openmodelica-doc-latest.tar.xz --strip-components=2
rm openmodelica-doc-latest.tar.xz
wget --no-check-certificate https://openmodelica.org/doc/OpenModelicaUsersGuide/OpenModelicaUsersGuide-latest.pdfStart %OMDEV%\tools\msys\ucrt64.exe or %OMDEV%\tools\msys\mingw64.exe and run:
export PLATFORM="64" # 64 or 32 bit
export OPENMODELICA_SOURCE_DIR="d:\\path\\to\\OpenModelica"
export REVISION_SHORT=`cd $OPENMODELICA_SOURCE_DIR; git describe --match "v*.*" --always --abbrev=0`
export PRODUCT_VERSION="${REVISION_SHORT:1}"
# make a valid VIProductVersion by stripping everything after "-"
BEGIN=${PRODUCT_VERSION/-*/}
PRODUCT_VERSION=${PRODUCT_VERSION::${#BEGIN}}
PRODUCT_VERSION=${PRODUCT_VERSION}.0
# derive MSYSRUNTIME from MSYSTEM (set by the MSYS2 shell you're running in)
MSYSRUNTIME="mingw"
if [ "${MSYSTEM}" = "UCRT64" ]; then
MSYSRUNTIME="ucrt"
fi
# generate the list of files for the installer from your CMake install directory
python GenerateFilesList.py --MSYSRUNTIME="${MSYSRUNTIME}" --PLATFORMVERSION="${PLATFORM}" \
--OPENMODELICAHOME="${OPENMODELICAHOME}" --OPENMODELICASOURCEDIR="${OPENMODELICA_SOURCE_DIR}"
makensis //DMSYSRUNTIME="${MSYSRUNTIME}" \
//DPLATFORMVERSION="${PLATFORM}" \
//DOMVERSION="${REVISION_SHORT}" \
//DPRODUCTVERSION="${PRODUCT_VERSION}" \
OpenModelicaSetup.nsiNote
PRODUCT_VERSION needs to be in X.X.X.X format.
Warning
OpenModelicaSetup.nsi compresses with SetCompressor /FINAL LZMA, NSIS's
slowest but best-ratio compressor. It single-threads through the entire MSYS2
toolchain plus your OpenModelica install (tens of thousands of files, several
GB), so a full makensis run can easily take over an hour.
To sign the installer you'll need a code-signing certificate (SPC). See the doc for more information.
export SIGNTOOL=`find /c/Program\ Files\ \(x86\)/Windows\ Kits/10/ -wholename "*${XPREFIX}/signtool.exe" | tail -1`
"${SIGNTOOL}" sign /n "Me" /f MySPC.pfx /tr "http://timestamp.globalsign.com/tsa/r6advanced1" /a /td SHA256 /v OpenModelica.exe- Submit bugs through the OpenModelica GitHub issues.
- Pull requests are welcome ❤️