From 339240a864bbd1901494447da9efe48aa24eccd2 Mon Sep 17 00:00:00 2001 From: Debulois Quentin Date: Sun, 20 Sep 2020 22:07:39 +0200 Subject: Ajout de redim.iss pour Inno setup + redimensionnement de la fenetre sous windows --- Redim/config.py | 8 ++++++- Redim/main.py | 1 + redim.iss | 48 +++++++++++++++++++++++++++++++++++++ redim.spec | 73 ++++++++++++++++++++++++++++++--------------------------- 4 files changed, 94 insertions(+), 36 deletions(-) create mode 100644 redim.iss diff --git a/Redim/config.py b/Redim/config.py index b0ea2ee..2cbdafd 100644 --- a/Redim/config.py +++ b/Redim/config.py @@ -3,7 +3,7 @@ ainsi que la gestion de la supression des fichiers anciennement décompressés par pyinstaller""" from sys import platform -from os import mkdir, listdir, environ, getenv +from os import mkdir, listdir, environ, getenv, system from os.path import isdir, join, getmtime, isfile from time import time from shutil import rmtree @@ -69,3 +69,9 @@ class Config(): int(getmtime(join(environ["TMP"], i))) < (time() - 86400)): rmtree(join(environ["TMP"], i)) + + @staticmethod + def redimensionnement_fenetre(): + """Redimensionne la fenetre du CMD sous windows""" + if platform != "linux": + system("mode con: cols=70 lines=35") diff --git a/Redim/main.py b/Redim/main.py index e66cc89..74b9375 100644 --- a/Redim/main.py +++ b/Redim/main.py @@ -15,6 +15,7 @@ def main(): widget = QWidget() config = Config() redim = Redim() + config.redimensionnement_fenetre() while True: configuration = config.lecture() tui = Ui(configuration) diff --git a/redim.iss b/redim.iss new file mode 100644 index 0000000..45bb206 --- /dev/null +++ b/redim.iss @@ -0,0 +1,48 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "Redim" +#define MyAppVersion "1.0" +#define MyAppPublisher "Quentin Inc." +#define MyAppURL "https://debulois.fr" +#define MyAppExeName "Redim.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={{FCF826D1-36CE-4A3B-89DB-6621254B66CE} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +DisableProgramGroupPage=yes +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +OutputBaseFilename=Redim_1.0_setup +SetupIconFile=C:\Users\Utilisateur\Desktop\redim\Redim\Ressources\icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "french"; MessagesFile: "compiler:Languages\French.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "C:\Users\Utilisateur\Desktop\redim\dist\Redim\Redim.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\Utilisateur\Desktop\redim\dist\Redim\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/redim.spec b/redim.spec index 90e7672..782416d 100644 --- a/redim.spec +++ b/redim.spec @@ -1,35 +1,38 @@ -# -*- mode: python ; coding: utf-8 -*- - -block_cipher = None - - -a = Analysis(['Redim/main.py'], - pathex=[], - binaries=[], - datas=[], - hiddenimports=['Pillow'], - hookspath=[], - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) - -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) - -exe = EXE(pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - [], - name='Redim', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - upx_exclude=[], - runtime_tmpdir=None, - console=True , icon='Redim/Ressources/icon.ico') +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + + +a = Analysis(['Redim\\main.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=['Pillow'], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='Redim', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + icon='Redim/Ressources/icon.ico' ) +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='Redim') -- cgit v1.2.3