diff --git a/.gitignore b/.gitignore index 099b0a6..9baea95 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ docs/html *.json *.lpf *.lgg +*.spec .kdev4 AccountFree.pro AccountFree.pro.user diff --git a/README.md b/README.md new file mode 100644 index 0000000..ed97515 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Logarithm Plotter + +Create graphs with logarithm scales, namely BODE diagrams. + +## Install + +### Windows +You can generate installers from AccountFree after installing all the dependencies: +- Windows installer: + - You need `pyinstaller`. You can install it using `pip install pyinstaller`. + - Run the `win/build-windows.bat` script (or `win/build-wine.sh` if you're cross-compiling with wine on Linux) to build an exe for AccountFree. + - You also [NSIS](https://nsis.sourceforge.io/Main_Page) (Linux users can install the `nsis` package). + - Run the `win/package-windows.bat` script (or `win/package.wine.sh`if you're cross-compiling on Linux). You will find a accountfre-esetup.exe installer in the dist/logarithmplotter/ folder. + + +### Linux + +Run `bash linux/install_local.sh` + +## Legal notice + Logarithmic Plotter - Create graphs with logarithm scales. + Copyright (C) 2021 Ad5001 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . diff --git a/linux/install_local.sh b/linux/install_local.sh index a6855df..7271387 100644 --- a/linux/install_local.sh +++ b/linux/install_local.sh @@ -7,6 +7,6 @@ echo "Installing mime-type..." mkdir -p ~/.local/share/applications sed "s+/home/ad5001/Apps/LogarithmPlotter/+$APPROOT/+g" "$APPROOT/linux/x-logarithm-plotter.xml" > ~/.local/share/mime/packages/x-logarithm-plotter.xml mkdir -p ~/.local/share/icons/hicolor/scalable/mimetypes -cp "$APPROOT/linux/logplotterfile.svg" ~/.local/share/icons/hicolor/scalable/mimetypes/application-x-logarithm-plotter.svg +cp "$APPROOT/logplotterfile.svg" ~/.local/share/icons/hicolor/scalable/mimetypes/application-x-logarithm-plotter.svg update-mime-database ~/.local/share/mime/ update-icon-caches ~/.local/share/icons/hicolor diff --git a/linux/logplotterfile.svg b/logplotterfile.svg similarity index 100% rename from linux/logplotterfile.svg rename to logplotterfile.svg diff --git a/win/build-windows.bat b/win/build-windows.bat new file mode 100644 index 0000000..0582764 --- /dev/null +++ b/win/build-windows.bat @@ -0,0 +1,5 @@ +cd .. +cp run.py logarithmplotter.py +python -m pip install -U pyinstaller +pyinstaller --add-data "qml;qml" --noconsole logarithmplotter.py --icon=win/logplotter.ico +rm logarithmplotter.py diff --git a/win/build-wine.sh b/win/build-wine.sh new file mode 100644 index 0000000..4710793 --- /dev/null +++ b/win/build-wine.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Giving pyinstaller another run +cd .. +rm $(find . -name "*.qmlc") +rm $(find . -name "*.pyc") +cp run.py logarithmplotter.py +wine python -m pip install -U pyinstaller +wine pyinstaller --add-data "qml;qml" --noconsole logarithmplotter.py --icon=win/logplotter.ico +rm logarithmplotter.py diff --git a/win/inst_banner.bmp b/win/inst_banner.bmp new file mode 100644 index 0000000..c907e55 Binary files /dev/null and b/win/inst_banner.bmp differ diff --git a/win/installer.nsi b/win/installer.nsi new file mode 100644 index 0000000..8873715 --- /dev/null +++ b/win/installer.nsi @@ -0,0 +1,187 @@ +; Modern UI definitions +;-------------------------------- +;Include Modern UI + +!include "MUI2.nsh" + +;-------------------------------- +;Definitions +!define APP_NAME "LogarithmPlotter" +!define DEV_NAME "Ad5001" +!define WEBSITE "https://logarithmplotter.org" +!define APP_VERSION "0.0.1.0" +!define COPYRIGHT "Ad5001 © 2021" +!define DESCRIPTION "Browse and use online services, free of account." + +!define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter" + +;-------------------------------- +;General description +Name "${APP_NAME}" +Caption "${APP_NAME}" +BrandingText "${APP_NAME}" +OutFile "logarithmplotter-setup.exe" +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}" +VIAddVersionKey "FileVersion" "${VERSION}" + + +;-------------------------------- +;defines MUST come before pages to apply to them + +!define MUI_PAGE_HEADER_TEXT "${APP_NAME} v${APP_VERSION}" +!define MUI_PAGE_HEADER_SUBTEXT "${COPYRIGHT}" + +!define MUI_WELCOMEPAGE_TITLE "Install ${APP_NAME} v${APP_VERSION}" +!define MUI_WELCOMEPAGE_TEXT "Welcome to the ${APP_NAME} installer! Follow the steps provided by this installer to install ${APP_NAME}" +!define MUI_HEADERIMAGE_RIGHT +;Extra space for the title area +;!insertmacro MUI_WELCOMEPAGE_TITLE_3LINES + +;Icons +Icon "logplotter.ico" +;!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!" +!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "${APP_NAME} v${APP_VERSION} was installed on your computer" +!define MUI_INSTFILESPAGE_ABORTHEADER_TEXT "There was an error during the installation process." +!define MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT "${APP_NAME} v${APP_VERSION} was not installed on your computer." + +!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 +;!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +;Languages + +!insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Included files +Section "" + SetOutPath $INSTDIR + File logarithmplotter.exe + File *.dll + File *.pyd + File *.md + File *.manifest + File *.zip + File *.bmp + File *.ico + File /r qml + File /r PySide2 + File /r shiboken2 + + + CreateShortcut "$SMPROGRAMS\LogarithmPlotter.lnk" "$INSTDIR\logarithmplotter.exe" + + WriteUninstaller $INSTDIR\uninstall.exe + WriteRegStr HKLM ${REG_UNINSTALL} "DisplayName" "LogarithmPlotter" + WriteRegStr HKLM ${REG_UNINSTALL} "UninstallString" "$INSTDIR\uninstall.exe" + WriteRegStr HKLM ${REG_UNINSTALL} "QuietUninstallString" "$INSTDIR\uninstall.exe /S" + WriteRegStr HKLM ${REG_UNINSTALL} "DisplayIcon" "$INSTDIR\logarithmplotter.bmp" + WriteRegStr HKLM ${REG_UNINSTALL} "DisplayVersion" "${VERSION}" + WriteRegStr HKLM ${REG_UNINSTALL} "Readme" "$INSTDIR\README.md" + WriteRegStr HKLM ${REG_UNINSTALL} "URLInfoAbout" "${WEBSITE}" + + SectionEnd + + ;-------------------------------- + ;Uninstaller Section + ; + Section "Uninstall" + + RMDir /r "$INSTDIR" + + Delete "$SMPROGRAMS\LogarithmPlotter.lnk" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter" +; ;DeleteRegKey /ifempty HKCU "Software\Modern UI Test" +; +SectionEnd diff --git a/win/package-windows.bat b/win/package-windows.bat new file mode 100644 index 0000000..cc7d33b --- /dev/null +++ b/win/package-windows.bat @@ -0,0 +1,5 @@ +cd .. +cp * ../README.md ../LICENSE.md ../dist/logarithmplotter/ +# Creating installer +cd ../dist/logarithmplotter/ +"C:\Program Files (x86)\NSIS\makensis" installer.nsi diff --git a/win/package-wine.sh b/win/package-wine.sh new file mode 100644 index 0000000..4c73b72 --- /dev/null +++ b/win/package-wine.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Moving files +cp * ../README.md ../LICENSE.md ../dist/logarithmplotter/ +# Creating installer +cd ../dist/logarithmplotter/ +makensis installer.nsi