Skip to content

Commit

Permalink
Publish Version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lixuannan committed Aug 1, 2023
1 parent 15e7e17 commit ac8c546
Show file tree
Hide file tree
Showing 4 changed files with 350 additions and 1 deletion.
71 changes: 71 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import os


for i in os.popen("pyinstaller -y -D -w -n CodeLib-Local -i icon\\icon.ico --clean --hidden-import ui --hidden-import "
"resources --hidden-import syncer --add-data .\\data.db.template;.\\ main.py"):
print(i)

s = ""
for root, dirs, files in os.walk("G:\\Project\\CodeLib-Local\\dist\\CodeLib-Local"):
x = root.replace('G:\\Project\\CodeLib-Local\\dist\\CodeLib-Local', '')
for file in files:
t = f"Source: \"{os.path.join(root, file)}\"; DestDir: " + "\"{app}" + f"{x}\";"
s += t + '\n'

with open("packaging.iss", "wt") as f:
f.write("""; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "CodeLib-Local"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "CodingCow's Perosonal Office"
#define MyAppURL "https://github.com/lixuannan/CodeLib-Local"
#define MyAppExeName "CodeLib-Local.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={{24AA0E85-23EA-4004-830B-FD7D32598DDC}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=G:\\Project\\CodeLib-Local\\LICENSE
; Remove the following line to run in administrative install mode (install for all users.)
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=G:\\Project\\CodeLib-Local\dist
OutputBaseFilename=CodeLib-Local-Setup-Win
SetupIconFile=G:\\Project\\CodeLib-Local\\icon\\icon.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\\ChineseSimplified.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
""")
f.write(s)
f.write("""
[Icons]
Name: "{group}\\{#MyAppName}"; Filename: "{app}\\{#MyAppExeName}"
Name: "{group}\\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
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
""")

# os.popen("packaging.iss")
Binary file added icon/icon.ico
Binary file not shown.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import base64
import sys
import os
import os.path
import sqlite3

import pyperclip
Expand Down Expand Up @@ -246,6 +246,9 @@ def sync(self):


if __name__ == '__main__':
if not os.path.isfile("data.db"):
os.rename("data.db.template", "data.db")

settings = {}
default_site = {}
db = sqlite3.connect("data.db")
Expand Down
Loading

0 comments on commit ac8c546

Please sign in to comment.