!include "MUI2.nsh" !include "WinVer.nsh" ;------------------------------------------------------------------------------- ; Constants !define PRODUCT_NAME "Boiii Application" !define PRODUCT_DESCRIPTION "Boiii Application Description" !define COPYRIGHT "Copyright © 2023 Your Company" !define PRODUCT_VERSION "1.0.0.0" !define SETUP_VERSION "1.0.0.0" ;------------------------------------------------------------------------------- ; Attributes Name "${PRODUCT_NAME}" OutFile "BoiiiInstaller.exe" InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" RequestExecutionLevel user ; Request user-level execution, not admin ;------------------------------------------------------------------------------- ; Version Info VIProductVersion "${PRODUCT_VERSION}" VIAddVersionKey "ProductName" "${PRODUCT_NAME}" VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}" VIAddVersionKey "FileDescription" "${PRODUCT_DESCRIPTION}" VIAddVersionKey "LegalCopyright" "${COPYRIGHT}" VIAddVersionKey "FileVersion" "${SETUP_VERSION}" ;------------------------------------------------------------------------------- ; Modern UI Appearance !define MUI_ICON "Contrib\Graphics\Icons\modern-install.ico" !define MUI_UNICON "Contrib\Graphics\Icons\modern-install.ico" !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "Contrib\Graphics\Icons\modern-install.ico" !define MUI_WELCOMEFINISHPAGE_BITMAP "Contrib\Graphics\Icons\modern-install.ico" !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_FINISHPAGE_RUN "$INSTDIR\boiii.exe" !define MUI_FINISHPAGE_LINK "Create a desktop shortcut" !define MUI_FINISHPAGE_TEXT "Setup has finished installing ${PRODUCT_NAME} on your computer.$\n$\nClick Finish to close this wizard." ;------------------------------------------------------------------------------- ; Modern UI Settings !define MUI_ABORTWARNING !define MUI_UNABORTWARNING ;------------------------------------------------------------------------------- ; Pages !insertmacro MUI_PAGE_WELCOME ;!insertmacro MUI_PAGE_LICENSE "Readme.txt" !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH ;------------------------------------------------------------------------------- ; Languages !insertmacro MUI_LANGUAGE "English" ;------------------------------------------------------------------------------- ; Sections Section "Main Application" SecMain SetOutPath $INSTDIR File "boiii.exe" SectionEnd Section "LocalAppData Files" SecData SetOutPath $LOCALAPPDATA\boiii File /r "boiii\*.*" SectionEnd Section -Post SetOutPath $INSTDIR WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd ;------------------------------------------------------------------------------- ; Uninstaller Sections Section "Uninstall" Delete $INSTDIR\boiii.exe Delete "$DESKTOP\Boiii.lnk" RMDir /r $LOCALAPPDATA\boiii Delete "$INSTDIR\Uninstall.exe" RMDir $INSTDIR SectionEnd ;------------------------------------------------------------------------------- ; Functions Function .onInit ; Set default installation directory WriteRegStr HKCU "Software\${PRODUCT_NAME}" "" $INSTDIR FunctionEnd Function .onInstSuccess ; Create a desktop shortcut based on user's choice ReadINIStr $R0 "$PLUGINSDIR\ioSpecial.ini" "Field 2" "State" ${If} $R0 == "1" CreateShortcut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\boiii.exe" ${EndIf} FunctionEnd ; Custom finish page actions Function MyFinishPage ; Actions for the custom finish page FunctionEnd