From 3db95d9cb2bf3bda80bdd985dd0019bec0d0c85b Mon Sep 17 00:00:00 2001 From: Laurence Kedward Date: Sun, 21 Nov 2021 15:05:31 +0000 Subject: Add: files and workflow to make installer on release. (#616) --- ci/fpm-installer.nsi | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++ ci/installer-icon.ico | Bin 0 -> 16958 bytes 2 files changed, 112 insertions(+) create mode 100644 ci/fpm-installer.nsi create mode 100644 ci/installer-icon.ico (limited to 'ci') diff --git a/ci/fpm-installer.nsi b/ci/fpm-installer.nsi new file mode 100644 index 0000000..0c0243b --- /dev/null +++ b/ci/fpm-installer.nsi @@ -0,0 +1,112 @@ +; NSIS Installer script for the Fortran Package Manager + +; ---------------- Properties ---------------- +; Name used in installer GUI +Name "Fortran Package Manager" + +; Name for folder location and reg key +!define INSTALL_NAME "fortran-lang" + +; Installer icon +!define MUI_ICON "installer-icon.ico" + +; Compress installer +SetCompress auto + +; Always produce unicode installer +Unicode true + +; ---------------- Setup ---------------- +; Use EnVar plugin (https://nsis.sourceforge.io/EnVar_plug-in) +!addplugindir ".\EnVar_plugin\Plugins\x86-unicode" + +; Use the 'Modern' Installer UI macros +!include "MUI2.nsh" + +; Default installation folder (local) +InstallDir "$LOCALAPPDATA\${INSTALL_NAME}" + +; Get installation folder from registry if available +InstallDirRegKey HKCU "Software\${INSTALL_NAME}" "" + +; Request application privileges +RequestExecutionLevel user + + +; ---------------- Installer Pages ---------------- +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES + + +; ---------------- Uninstaller Pages ---------------- +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + + +; MUI Language +!insertmacro MUI_LANGUAGE "English" + + +; ---------------- Component: Core Installation ---------------- +Section "-Core" SecCore + + SetOutPath "$INSTDIR" + + ; Store installation folder + WriteRegStr HKCU "Software\${INSTALL_NAME}" "" $INSTDIR + + ; Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + ; Add to path + EnVar::SetHKCU + EnVar::AddValue "PATH" "$INSTDIR\fpm" + EnVar::AddValue "PATH" "$INSTDIR\MinGit\mingw64\bin" + +SectionEnd + + +; ---------------- Component: fpm ---------------- +Section "FPM" SecFPM + + SetOutPath "$INSTDIR\fpm" + + File "fpm.exe" + +SectionEnd + + +; ---------------- Component: Git ---------------- +Section "Git for Windows" SecGit + + SetOutPath "$INSTDIR" + + File /r "MinGit" + +SectionEnd + + +; ---------------- Uninstaller ---------------- +Section "Uninstall" + + RMDir /r "$INSTDIR" + + DeleteRegKey /ifempty HKCU "Software\${INSTALL_NAME}" + + EnVar::SetHKCU + EnVar::DeleteValue "PATH" "$INSTDIR\fpm" + EnVar::DeleteValue "PATH" "$INSTDIR\MinGit\mingw64\bin" + +SectionEnd + + +; ---------------- Component description Strings (EN) ---------------- +LangString DESC_SecFPM ${LANG_ENGLISH} "The Fortran Package Manager" +LangString DESC_SecGit ${LANG_ENGLISH} "Git version control (required for FPM)" + + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecFPM} $(DESC_SecFPM) + !insertmacro MUI_DESCRIPTION_TEXT ${SecGit} $(DESC_SecGit) +!insertmacro MUI_FUNCTION_DESCRIPTION_END diff --git a/ci/installer-icon.ico b/ci/installer-icon.ico new file mode 100644 index 0000000..a360390 Binary files /dev/null and b/ci/installer-icon.ico differ -- cgit v1.2.3