Commit 9d4fdf1b authored by Michael Rudolf's avatar Michael Rudolf
Browse files

Added icons and config files for setup and install

parent f7ea3060
......@@ -8,18 +8,15 @@ Examples/
*.tdms
*.h5
*.asc
*.txt
# Ignore config files
*.ini
# ignore pictures and pdfs
*.pdf
*.png
*.jpg
*.eps
*.synctex.gz
*.ai
# Byte-compiled / optimized / DLL files
......@@ -49,6 +46,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
*.exe
# PyInstaller
# Usually these files are written by a python script from a template
......
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "RST_pick_GUI"
#define MyAppVersion "0.2.4"
#define MyAppPublisher "Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences"
#define MyAppURL "https://git.gfz-potsdam.de/analab-code/rst-evaluation"
#define MyAppExeName "RST_pick_GUI.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{1E919B1F-115F-42A9-8FBA-F09FB696E072}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=D:\nextcloud\GitRepos\rst-evaluation\LICENSE.txt
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=D:\nextcloud\GitRepos\rst-evaluation\installer
OutputBaseFilename=setup_RST_pick_GUI
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "D:\nextcloud\GitRepos\rst-evaluation\dist\RST_pick_GUI\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\nextcloud\GitRepos\rst-evaluation\dist\RST_pick_GUI\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
......@@ -4,12 +4,14 @@ Created on Mon Jul 23 14:32:17 2018
@author: Michael Warsitzka, Michael Rudolf
"""
# import pandas as pd
import os
# *************************************************************************
# %%===========================IMPORT==========================================
import numpy as np
# import pandas as pd
import os
import RST_Func as rfnc
from . import RST_Func as rfnc
# %%==========================NAMES============================================
projectname = 'example'
......
......@@ -3,7 +3,7 @@
# @Author: M. Rudolf, M. Warsitzka
# @Date: 2019-02-20 12:00:00
# @Last Modified by: M. Rudolf
# @Last Modified time: 2020-09-24 14:54:27
# @Last Modified time: 2021-01-22 12:00:30
"""
RST_pick_GUI.py
......@@ -17,13 +17,13 @@ import json
import logging
import os
import re
import subprocess
import sys
import tkinter as tk
import warnings
from tkinter import filedialog, messagebox
import subprocess
import RST_Func as rfnc
import RSTpicking.RST_Func as rfnc
warnings.filterwarnings("ignore")
log = logging.getLogger()
......@@ -161,7 +161,7 @@ class RST_pick_GUI(tk.Tk):
"""Detects high dpi displays and rescales gui in Windows
Adapted from the user 'dingles at stack-overflow"""
if os.name == "nt":
from ctypes import windll, pointer, wintypes
from ctypes import pointer, windll, wintypes
try:
windll.shcore.SetProcessDpiAwareness(1)
except Exception as _:
......@@ -539,7 +539,23 @@ class RST_pick_GUI(tk.Tk):
self.cfg = config
if __name__ == '__main__':
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
base_path = getattr(
sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__))
)
return os.path.join(base_path, relative_path)
def run():
app = RST_pick_GUI(None)
app.title('RSTpick GUI')
image_path = resource_path(
os.path.join('images', 'rst-evaluation_x256.ico')
)
app.iconbitmap(image_path)
app.mainloop()
if __name__ == '__main__':
run()
from . import RST_Func, RST_pick_GUI
convert -resize x256 -gravity center -crop 256x256+0+0 rst-evaluation.png -colors 256 -background transparent rst-evaluation_x256.ico
This diff is collapsed.
:: Windows Command Line script to prepare the package and build an executable
:: for windows.
@ECHO OFF
:: Compute requirements.txt
pipreqs --force --no-pin --ignore "./RSTpicking/build/","./RSTpicking/dist/", "./build/","./dist/"
:: Create executable
python -m pip install pyinstaller
pyinstaller --clean -y --icon "D:\nextcloud\GitRepos\rst-evaluation\RSTpicking\images\rst-evaluation_x256.ico" --add-data "D:\nextcloud\GitRepos\rst-evaluation\RSTpicking\images\rst-evaluation_x256.ico;images" "RSTpicking\RST_pick_GUI.py"
:: Create installer (requires InnoSetup on $PATH)
iscc "RST_pick_GUI.iss"
# Shell script to prepare the package for installation with pip
# Compute requirements.txt
pipreqs --force --no-pin --ignore "./RSTpicking/build/","./RSTpicking/dist/"
# Install package with pip
pip install -e .
[metadata]
name = rstevaluation
version = 0.2.4
[options]
packages = find_namespace:
import setuptools
setuptools.setup()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment