2021-06-22 01:33:42 +02:00
Unicode True
2021-06-02 19:14:42 +02:00
; Modern UI definitions
;--------------------------------
;Include Modern UI
!include " MUI2.nsh "
;--------------------------------
;Definitions
!define APP_NAME " LogarithmPlotter "
2021-08-16 23:17:38 +02:00
!define PROG_ID " LogarithmPlotter.File.1 "
2021-06-02 19:14:42 +02:00
!define DEV_NAME " Ad5001 "
2021-08-26 20:27:38 +02:00
!define WEBSITE " https://apps.ad5001.eu/logarithmplotter "
2024-04-03 22:05:57 +02:00
!define VERSION_SHORT " 0.6.0 "
2022-01-20 12:10:11 +01:00
!define APP_VERSION " ${VERSION_SHORT}.0 "
2024-01-11 00:11:09 +01:00
!define COPYRIGHT " Ad5001 (c) 2021-2024 "
2024-09-30 00:23:39 +02:00
!define DESCRIPTION " Create graphs with logarithmic scales. "
2021-06-02 19:14:42 +02:00
!define REG_UNINSTALL " Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter "
2021-08-16 23:17:38 +02:00
!define REG_APPPATHS " Software\Microsoft\Windows\CurrentVersion\App Paths\logarithmplotter.exe "
!define REG_LPFCLASS " Software\Classes\${PROG_ID} "
!define REG_LPFEXT " Software\Classes\.lpf "
2021-06-02 19:14:42 +02:00
;--------------------------------
;General description
Name " ${APP_NAME} "
Caption " ${APP_NAME} "
BrandingText " ${APP_NAME} "
2022-01-20 12:10:11 +01:00
OutFile " logarithmplotter-v${VERSION_SHORT}-setup.exe "
2021-06-02 19:14:42 +02:00
RequestExecutionLevel admin
;Default installation folder
InstallDir " $PROGRAMFILES \LogarithmPlotter "
;--------------------------------
;Additional parameters
SetCompressor ZLIB
VIProductVersion " ${APP_VERSION} "
VIAddVersionKey " ProductName " " ${APP_NAME} "
VIAddVersionKey " CompanyName " " ${DEV_NAME} "
VIAddVersionKey " LegalCopyright " " ${COPYRIGHT} "
VIAddVersionKey " FileDescription " " ${DESCRIPTION} "
2021-06-22 01:33:42 +02:00
VIAddVersionKey " FileVersion " " ${APP_VERSION} "
2021-06-02 19:14:42 +02:00
;--------------------------------
;defines MUST come before pages to apply to them
2022-01-20 12:10:11 +01:00
!define MUI_PAGE_HEADER_TEXT " ${APP_NAME} v${VERSION_SHORT} "
2021-06-02 19:14:42 +02:00
!define MUI_PAGE_HEADER_SUBTEXT " ${COPYRIGHT} "
2022-01-20 12:10:11 +01:00
!define MUI_WELCOMEPAGE_TITLE " Install ${APP_NAME} v${VERSION_SHORT} "
2024-01-11 01:15:43 +01:00
!define MUI_WELCOMEPAGE_TEXT " Thank you for downloading ${APP_NAME}! Follow the steps provided by this installer to install ${APP_NAME}. "
2021-06-02 19:14:42 +02:00
!define MUI_HEADERIMAGE_RIGHT
;Extra space for the title area
;!insertmacro MUI_WELCOMEPAGE_TITLE_3LINES
;Icons
2021-06-22 01:33:42 +02:00
Icon " logarithmplotter.ico "
2021-08-26 18:57:49 +02:00
!define MUI_ICON " logarithmplotter.ico "
2021-06-02 19:14:42 +02:00
;!define MUI_HEADERIMAGE
;!define MUI_HEADERIMAGE_BITMAP "logarithmplotter.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP " inst_banner.bmp "
!define MUI_UNWELCOMEFINISHPAGE_BITMAP " inst_banner.bmp "
!define MUI_LICENSEPAGE_TEXT_TOP " This software is governed by the following terms: "
!define MUI_LICENSEPAGE_TEXT_BOTTOM " Have you read and agreed the terms of the license? "
!define MUI_LICENSEPAGE_BUTTON " Next "
;Display a checkbox the user has to check to agree with the license terms.
;!define MUI_LICENSEPAGE_CHECKBOX
;!define MUI_LICENSEPAGE_CHECKBOX_TEXT "I agree"
;*OR*
;Display two radio buttons to allow the user to choose between accepting the license terms or not.
!define MUI_LICENSEPAGE_RADIOBUTTONS
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT " I agree "
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE " I disagree "
;!define MUI_COMPONENTSPAGE_TEXT_TOP "Select some Monkeys"
;!define MUI_COMPONENTSPAGE_TEXT_COMPLIST "Choose your Monkeys:"
;!define MUI_COMPONENTSPAGE_TEXT_INSTTYPE "Monkey List:"
;!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE "MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE"
;!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO "MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO"
;!define MUI_DIRECTORYPAGE_TEXT_TOP "MUI_DIRECTORYPAGE_TEXT_TOP"
;!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "MUI_DIRECTORYPAGE_TEXT_DESTINATION"
;!define MUI_DIRECTORYPAGE_VARIABLE $INSTDIR
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT " Success! "
2024-01-11 01:15:43 +01:00
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT " ${APP_NAME} v${VERSION_SHORT} was installed on your computer. "
2021-06-02 19:14:42 +02:00
!define MUI_INSTFILESPAGE_ABORTHEADER_TEXT " There was an error during the installation process. "
2022-01-20 12:10:11 +01:00
!define MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT " ${APP_NAME} v${VERSION_SHORT} was not installed on your computer. "
2021-06-02 19:14:42 +02:00
!define MUI_FINISHPAGE_TITLE " Finished! "
;!define MUI_FINISHPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_TEXT " Press 'Finish' to close this installer program. "
;Extra space for the text area (if using checkboxes).
;!define MUI_FINISHPAGE_TEXT_LARGE
!define MUI_FINISHPAGE_BUTTON " Finish "
;!define MUI_FINISHPAGE_CANCEL_ENABLED
;!define MUI_FINISHPAGE_TEXT_REBOOT "MUI_FINISHPAGE_TEXT_REBOOT"
;!define MUI_FINISHPAGE_TEXT_REBOOTNOW "MUI_FINISHPAGE_TEXT_REBOOTNOW"
;!define MUI_FINISHPAGE_TEXT_REBOOTLATER "MUI_FINISHPAGE_TEXT_REBOOTLATER"
;!define MUI_FINISHPAGE_TEXT_REBOOTLATER_DEFAULT
!define MUI_FINISHPAGE_RUN " logarithmplotter.exe "
!define MUI_FINISHPAGE_RUN_TEXT " Run ${APP_NAME} "
;Parameters for the application to run. Don't forget to escape double quotes in the value (use $\").
;!define MUI_FINISHPAGE_RUN_PARAMETERS
;!define MUI_FINISHPAGE_RUN_NOTCHECKED
;!define MUI_FINISHPAGE_RUN_FUNCTION
!define MUI_FINISHPAGE_SHOWREADME " README.md "
;Don't make this label too long or it'll cut on top and bottom.
!define MUI_FINISHPAGE_SHOWREADME_TEXT " Open README "
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
;MUI_FINISHPAGE_SHOWREADME_FUNCTION Function
!define MUI_FINISHPAGE_LINK " ${APP_NAME}'s website "
!define MUI_FINISHPAGE_LINK_LOCATION " ${WEBSITE} "
;!define MUI_FINISHPAGE_LINK_COLOR RRGGBB
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
;!define MUI_UNCONFIRMPAGE_TEXT_TOP "MUI_UNCONFIRMPAGE_TEXT_TOP"
;!define MUI_UNCONFIRMPAGE_TEXT_LOCATION "MUI_UNCONFIRMPAGE_TEXT_LOCATION"
;hide descriptions on hover
;!define MUI_COMPONENTSPAGE_NODESC
;--------------------------------
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE " LICENSE.md "
;!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
2021-06-22 18:39:03 +02:00
!insertmacro MUI_UNPAGE_INSTFILES
2021-06-02 19:14:42 +02:00
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE " English "
;--------------------------------
;Included files
Section " "
SetOutPath $INSTDIR
File logarithmplotter.exe
File * .md
File * .bmp
File * .ico
2024-01-11 01:15:43 +01:00
File /r _internal
2021-06-02 19:14:42 +02:00
CreateShortcut " $SMPROGRAMS \LogarithmPlotter.lnk " " $INSTDIR \logarithmplotter.exe "
WriteUninstaller $INSTDIR \ uninstall.exe
WriteRegStr HKLM ${REG_UNINSTALL} " DisplayName " " LogarithmPlotter "
2021-08-26 20:19:07 +02:00
WriteRegStr HKLM ${REG_UNINSTALL} " Publisher " " Ad5001 "
2021-06-02 19:14:42 +02:00
WriteRegStr HKLM ${REG_UNINSTALL} " UninstallString " " $INSTDIR \uninstall.exe "
WriteRegStr HKLM ${REG_UNINSTALL} " QuietUninstallString " " $INSTDIR \uninstall.exe /S "
2021-08-26 20:19:07 +02:00
WriteRegStr HKLM ${REG_UNINSTALL} " DisplayIcon " " $INSTDIR \logarithmplotter.ico "
2021-06-22 01:33:42 +02:00
WriteRegStr HKLM ${REG_UNINSTALL} " DisplayVersion " " ${APP_VERSION} "
2021-06-02 19:14:42 +02:00
WriteRegStr HKLM ${REG_UNINSTALL} " Readme " " $INSTDIR \README.md "
WriteRegStr HKLM ${REG_UNINSTALL} " URLInfoAbout " " ${WEBSITE} "
2021-08-16 23:17:38 +02:00
; Registering application
;WriteRegStr HKLM ${REG_APPPATHS} "" "$INSTDIR\logarithmplotter.exe"
;WriteRegStr HKLM ${REG_APPPATHS} "SupportedProtocols" "file:"
; Registering mime type
WriteRegStr HKLM ${REG_LPFCLASS} " " " Logarithm Plot File "
WriteRegStr HKLM " ${REG_LPFCLASS}\DefaultIcon " " " " $INSTDIR \logarithmplotter.exe,0 " ; I'd like to put the logplotterfile icon, but this seems far too difficult to do.
2021-08-26 19:47:44 +02:00
WriteRegStr HKLM " ${REG_LPFCLASS}\shell\open\command " " " " $INSTDIR \logarithmplotter.exe $\ " % 1$ \ " "
WriteRegStr HKLM " ${REG_LPFCLASS}\shell\edit\command " " " " $INSTDIR \logarithmplotter.exe $\ " % 1$ \ " "
2021-08-16 23:17:38 +02:00
WriteRegStr HKLM ${REG_LPFEXT} " " " ${PROG_ID} "
WriteRegStr HKLM ${REG_LPFEXT} " Content Type " " application/x-logarithm-plot "
WriteRegStr HKLM ${REG_LPFEXT} " PerceivedType " " Application "
2021-06-22 01:33:42 +02:00
SectionEnd
2021-06-02 19:14:42 +02:00
2021-06-22 01:33:42 +02:00
;--------------------------------
;Uninstaller Section
;
Section " Uninstall "
2021-06-02 19:14:42 +02:00
RMDir /r " $INSTDIR "
Delete " $SMPROGRAMS \LogarithmPlotter.lnk "
2021-08-26 18:34:17 +02:00
DeleteRegKey HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter "
DeleteRegKey HKLM " Software\Microsoft\Windows\CurrentVersion\App Paths\logarithmplotter.exe "
2021-06-02 19:14:42 +02:00
; ;DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
;
SectionEnd