Basic database backup feature added.
This commit is contained in:
44
PECOS - Set up.iss
Normal file
44
PECOS - Set up.iss
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
; Script generated by the Inno Setup Script Wizard.
|
||||||
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
|
#define MyAppName "PECOS - Polaris Emergency Check Out System"
|
||||||
|
#define MyAppVersion "1.1 Beta"
|
||||||
|
#define MyAppPublisher "Tanglewood Hill"
|
||||||
|
#define MyAppExeName "pecos.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={{12C1E773-3C56-4243-A0EC-34EC567097E9}
|
||||||
|
AppName={#MyAppName}
|
||||||
|
AppVersion={#MyAppVersion}
|
||||||
|
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||||
|
AppPublisher={#MyAppPublisher}
|
||||||
|
DefaultDirName=C:\PECOS
|
||||||
|
DisableProgramGroupPage=yes
|
||||||
|
; Uncomment the following line to run in non administrative install mode (install for current user only.)
|
||||||
|
;PrivilegesRequired=lowest
|
||||||
|
OutputBaseFilename=mysetup
|
||||||
|
SetupIconFile=C:\Users\danie\Workbench\Windows\PECOS.ico
|
||||||
|
Compression=lzma
|
||||||
|
SolidCompression=yes
|
||||||
|
WizardStyle=modern
|
||||||
|
|
||||||
|
[Languages]
|
||||||
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "C:\Users\danie\Workbench\Windows\pecos.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Source: "C:\Users\danie\Workbench\Windows\*"; 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
|
||||||
|
|
@ -230,8 +230,33 @@ class Toplevel1:
|
|||||||
|
|
||||||
#subprocess.run(['open', 'export.html'], check=True) # Open export.html in the default web browser (macOS)
|
#subprocess.run(['open', 'export.html'], check=True) # Open export.html in the default web browser (macOS)
|
||||||
os.startfile('export.html') # Open export.html in the default web browser (Windows)
|
os.startfile('export.html') # Open export.html in the default web browser (Windows)
|
||||||
|
|
||||||
|
|
||||||
|
# --- BACKUP THE DATABASE AND BARCODES EVERY FIVE MINTUES ---
|
||||||
|
def BackupData():
|
||||||
|
# Set path variables for backup folders
|
||||||
|
ItemFolder = 'item/'
|
||||||
|
ItemBackup = 'itembackup/'
|
||||||
|
PatronFolder = 'patron/'
|
||||||
|
PatronBackup = 'patronbackup/'
|
||||||
|
DatabaseFile = 'checkouts.db'
|
||||||
|
dbBackup = 'checkouts-backup.db'
|
||||||
|
|
||||||
|
# Check to see if backup folders are there. If so, delete them.
|
||||||
|
if os.path.exists(ItemBackup):
|
||||||
|
shutil.rmtree(ItemBackup)
|
||||||
|
|
||||||
|
if os.path.exists(PatronBackup):
|
||||||
|
shutil.rmtree(PatronBackup)
|
||||||
|
|
||||||
|
if os.path.exists(dbBackup):
|
||||||
|
os.remove(dbBackup)
|
||||||
|
|
||||||
|
# Copy item, patron, and database folder to Backup
|
||||||
|
shutil.copytree(ItemFolder, ItemBackup)
|
||||||
|
shutil.copytree(PatronFolder, PatronBackup)
|
||||||
|
shutil.copy(DatabaseFile, dbBackup)
|
||||||
|
|
||||||
|
# --- END OF FUNCTIONS - BEGIN GUI ---
|
||||||
|
|
||||||
self.Canvas1 = tk.Canvas(top)
|
self.Canvas1 = tk.Canvas(top)
|
||||||
self.image = ImageTk.PhotoImage(Image.open("bg-01.png"))
|
self.image = ImageTk.PhotoImage(Image.open("bg-01.png"))
|
||||||
|
Reference in New Issue
Block a user