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