Commit dc20c876 authored by Michael Rudolf's avatar Michael Rudolf
Browse files

Updated installer scripts and fixed some imports.

parent 55a09488
This diff is collapsed.
......@@ -21,12 +21,12 @@ AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=C:\Users\Michael Rudolf\Nextcloud\GitRepos\rst-evaluation\LICENSE
LicenseFile=LICENSE
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=C:\Users\Michael Rudolf\Nextcloud\GitRepos\rst-evaluation\installer
OutputBaseFilename=setup_RST_pick_GUI
OutputDir=installer
OutputBaseFilename=setup_{#MyAppName}_{#MyAppVersion}
Compression=lzma
SolidCompression=yes
WizardStyle=modern
......@@ -61,8 +61,8 @@ Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Users\Michael Rudolf\Nextcloud\GitRepos\rst-evaluation\dist\RST_pick_GUI\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Michael Rudolf\Nextcloud\GitRepos\rst-evaluation\dist\RST_pick_GUI\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "dist\RST_pick_GUI\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "dist\RST_pick_GUI\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
......
......@@ -36,6 +36,6 @@ del "%sorted%"
:: Create executable
python -m pip install pyinstaller
python -m pip install pypiwin32
pyinstaller --clean -y --icon "C:\Users\Michael Rudolf\Nextcloud\GitRepos\rst-evaluation\rstevaluation\images\rst-evaluation_x256.ico" --add-data "C:\Users\Michael Rudolf\Nextcloud\GitRepos\rst-evaluation\rstevaluation\images\rst-evaluation_x256.ico;images" "C:\Users\Michael Rudolf\Nextcloud\GitRepos\rst-evaluation\rstevaluation\rstevaluation\RST_pick_GUI.py"
pyinstaller --clean -y "RST_pick_GUI.spec"
:: Create installer (requires InnoSetup on $PATH)
iscc "RST_pick_GUI.iss"
......@@ -21,46 +21,64 @@ from importlib import resources
def icon_rst():
""" Returns main application icon """
with resources.path('rstevaluation.icons', 'rst-evaluation.png') as fpath:
try:
with resources.path(
'rstevaluation.icons', 'rst-evaluation.png'
) as fpath:
phim = tk.PhotoImage(
file=fpath
)
except TypeError as _:
phim = tk.PhotoImage(file='rstevaluation\\icons\\rst-evaluation.png')
return phim
def icon_load():
""" Returns an icon for loading from a folder """
try:
with resources.path('rstevaluation.icons', 'home.png') as fpath:
phim = tk.PhotoImage(
file=fpath
)
except TypeError as _:
phim = tk.PhotoImage(file='rstevaluation\\icons\\home.png')
return phim
def icon_save():
""" Returns an icon for saving to a folder """
try:
with resources.path('rstevaluation.icons', 'filesave.png') as fpath:
phim = tk.PhotoImage(
file=fpath
)
except TypeError as _:
phim = tk.PhotoImage(file='rstevaluation\\icons\\filesave.png')
return phim
def icon_options():
""" Returns an icon for options """
try:
with resources.path('rstevaluation.icons', 'subplots.png') as fpath:
phim = tk.PhotoImage(
file=fpath
)
except TypeError as _:
phim = tk.PhotoImage(file='rstevaluation\\icons\\subplots.png')
return phim
def icon_start():
""" Returns an icon for processing """
try:
with resources.path(
'rstevaluation.icons', 'qt4_editor_options.png'
) as fpath:
phim = tk.PhotoImage(
file=fpath
)
except TypeError as _:
phim = tk.PhotoImage(
file='rstevaluation\\icons\\qt4_editor_options.png')
return phim
......@@ -245,9 +245,14 @@ class RST_pick_GUI(tk.Tk):
def add_tooltips(self):
""" Adds tooltips to all elements with an entry in tooltips.json """
# Get tooltip text
try:
with resources.path('rstevaluation', 'tooltips.json') as jpath:
with open(jpath) as jfile:
self.tooltips = json.load(jfile)
except FileNotFoundError as _:
jpath = 'tooltips.json'
with open(jpath) as jfile:
self.tooltips = json.load(jfile)
ttkeys = self.tooltips.keys()
all_vars = vars(self)
for k in all_vars.keys():
......
Supports Markdown
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