Skip to content

Commit 188f1ea

Browse files
committed
ImageTools: ADD: 修改安装位置,防止没有管理员权限创建不了文件夹;ADD: 单独编译子APP,用脚本同时编译
1 parent a9513bf commit 188f1ea

File tree

22 files changed

+319
-17
lines changed

22 files changed

+319
-17
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ __pycache__/
55
*.pyc
66
settings.json
77
*.mp4
8-
*.jpg
8+
*.jpg
9+
config/
10+
*.exe

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"python.pythonPath": "C:\\Users\\keda\\AppData\\Local\\Programs\\Python\\Python38\\python.exe",
2+
"python.pythonPath": "C:\\Users\\qinxing\\AppData\\Local\\Programs\\Python\\Python38\\python.exe",
33
// 默认对Python文件进行静态检查
44
"python.linting.enabled": true,
55

ImageTools.iss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "ImageTools"
5+
#define MyAppVersion "1.3"
6+
#define MyAppPublisher "liqinxing, Inc."
7+
#define MyAppURL "https://www.qinxing.xyz/"
8+
#define MyAppExeName "ImageTools.exe"
9+
10+
[Setup]
11+
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
12+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13+
AppId={{12F34F85-9D0D-4F1B-9492-E8875EE23A31}
14+
AppName={#MyAppName}
15+
AppVersion={#MyAppVersion}
16+
;AppVerName={#MyAppName} {#MyAppVersion}
17+
AppPublisher={#MyAppPublisher}
18+
AppPublisherURL={#MyAppURL}
19+
AppSupportURL={#MyAppURL}
20+
AppUpdatesURL={#MyAppURL}
21+
DefaultDirName=C:/ImageTools\{#MyAppName}
22+
DisableProgramGroupPage=yes
23+
; Uncomment the following line to run in non administrative install mode (install for current user only.)
24+
;PrivilegesRequired=lowest
25+
OutputDir=.\Output
26+
OutputBaseFilename=ImageTools
27+
SetupIconFile=.\ui\resource\main.ico
28+
Compression=lzma
29+
SolidCompression=yes
30+
WizardStyle=modern
31+
32+
[Languages]
33+
Name: "english"; MessagesFile: "compiler:Default.isl"
34+
35+
[Tasks]
36+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
37+
38+
[Files]
39+
Source: ".\dist\ImageTools\ImageTools.exe"; DestDir: "{app}"; Flags: ignoreversion
40+
Source: ".\dist\ImageTools\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
41+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
42+
43+
[Icons]
44+
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
45+
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
46+
47+
[Run]
48+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
49+

ImageTools.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def load_saved_windows(self):
4545
self.add_sub_window(name)
4646

4747
def add_sub_window(self, sub_window_name):
48-
sub_window = self.subwindow_function[sub_window_name](
49-
sub_window_name, self)
48+
sub_window = self.subwindow_function[sub_window_name](parent=self)
5049
self.subwindows_ui.addSubWindow(sub_window)
5150
self.sub_windows.append(sub_window)
5251
sub_window.show()

buildexe.bat

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
rm -r build
2-
rm -r dist
3-
pyinstaller -w ./ImageTools.py --noconfirm
4-
copy .\Readme.md .\dist\ImageTools\
5-
compil32 /cc "./setup.iss"
1+
DEL /q .\build\*
2+
DEL /q .\dist\*
3+
RD /S /Q .\build
4+
RD /S /Q .\dist
5+
start cmd /c "pyinstaller -w ./ImageTools.py --noconfirm && copy .\Readme.md .\dist\ImageTools\ && compil32 /cc ./ImageTools.iss"
6+
start cmd /c "pyinstaller -w --noconfirm ./subapps/PQtools2Code.py && compil32 /cc ./subapps/PQtools2Code.iss"
7+
start cmd /c "pyinstaller -w --noconfirm ./subapps/ShakeTestTool.py && compil32 /cc ./subapps/ShakeTestTool.iss"
8+
start cmd /c "pyinstaller -w --noconfirm ./subapps/FocusDepthTool.py && compil32 /cc ./subapps/FocusDepthTool.iss"
9+
start cmd /c "pyinstaller -w --noconfirm ./subapps/VideoCompare.py && compil32 /cc ./subapps/VideoCompare.iss"

subapps/FocusDepthTool.iss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "FocusDepthTool"
5+
#define MyAppVersion "1.3"
6+
#define MyAppPublisher "liqinxing, Inc."
7+
#define MyAppURL "https://www.qinxing.xyz/"
8+
#define MyAppExeName "FocusDepthTool.exe"
9+
10+
[Setup]
11+
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
12+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13+
AppId={{12F34F85-9D0D-4F1B-9492-E8875EE23A31}
14+
AppName={#MyAppName}
15+
AppVersion={#MyAppVersion}
16+
;AppVerName={#MyAppName} {#MyAppVersion}
17+
AppPublisher={#MyAppPublisher}
18+
AppPublisherURL={#MyAppURL}
19+
AppSupportURL={#MyAppURL}
20+
AppUpdatesURL={#MyAppURL}
21+
DefaultDirName=C:/ImageTools\{#MyAppName}
22+
DisableProgramGroupPage=yes
23+
; Uncomment the following line to run in non administrative install mode (install for current user only.)
24+
;PrivilegesRequired=lowest
25+
OutputDir=..\Output
26+
OutputBaseFilename={#MyAppName}
27+
SetupIconFile=..\ui\resource\main.ico
28+
Compression=lzma
29+
SolidCompression=yes
30+
WizardStyle=modern
31+
32+
[Languages]
33+
Name: "english"; MessagesFile: "compiler:Default.isl"
34+
35+
[Tasks]
36+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
37+
38+
[Files]
39+
Source: "..\dist\{#MyAppName}\{#MyAppName}.exe"; DestDir: "{app}"; Flags: ignoreversion
40+
Source: "..\dist\{#MyAppName}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
41+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
42+
43+
[Icons]
44+
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
45+
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
46+
47+
[Run]
48+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
49+

subapps/FocusDepthTool.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sys
2+
sys.path.append("..")
3+
from tools.depth_of_focus.depth_of_focus import FieldDepthWindow
4+
from PySide2.QtWidgets import QApplication
5+
from PySide2.QtCore import Qt
6+
7+
if __name__ == "__main__":
8+
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
9+
apps = QApplication([])
10+
apps.setStyle('Fusion')
11+
appswindow = FieldDepthWindow()
12+
appswindow.show()
13+
sys.exit(apps.exec_())

subapps/PQtools2Code.iss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "PQtools2Code"
5+
#define MyAppVersion "1.3"
6+
#define MyAppPublisher "liqinxing, Inc."
7+
#define MyAppURL "https://www.qinxing.xyz/"
8+
#define MyAppExeName "PQtools2Code.exe"
9+
10+
[Setup]
11+
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
12+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13+
AppId={{12F34F85-9D0D-4F1B-9492-E8875EE23A31}
14+
AppName={#MyAppName}
15+
AppVersion={#MyAppVersion}
16+
;AppVerName={#MyAppName} {#MyAppVersion}
17+
AppPublisher={#MyAppPublisher}
18+
AppPublisherURL={#MyAppURL}
19+
AppSupportURL={#MyAppURL}
20+
AppUpdatesURL={#MyAppURL}
21+
DefaultDirName=C:/ImageTools\{#MyAppName}
22+
DisableProgramGroupPage=yes
23+
; Uncomment the following line to run in non administrative install mode (install for current user only.)
24+
;PrivilegesRequired=lowest
25+
OutputDir=..\Output
26+
OutputBaseFilename={#MyAppName}
27+
SetupIconFile=..\ui\resource\main.ico
28+
Compression=lzma
29+
SolidCompression=yes
30+
WizardStyle=modern
31+
32+
[Languages]
33+
Name: "english"; MessagesFile: "compiler:Default.isl"
34+
35+
[Tasks]
36+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
37+
38+
[Files]
39+
Source: "..\dist\{#MyAppName}\{#MyAppName}.exe"; DestDir: "{app}"; Flags: ignoreversion
40+
Source: "..\dist\{#MyAppName}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
41+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
42+
43+
[Icons]
44+
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
45+
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
46+
47+
[Run]
48+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
49+

subapps/PQtools2Code.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sys
2+
sys.path.append("..")
3+
from tools.pqtools_to_code.pqtools_to_code import PQtoolsToCode
4+
from PySide2.QtWidgets import QApplication
5+
from PySide2.QtCore import Qt
6+
7+
if __name__ == "__main__":
8+
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
9+
apps = QApplication([])
10+
apps.setStyle('Fusion')
11+
appswindow = PQtoolsToCode()
12+
appswindow.show()
13+
sys.exit(apps.exec_())

subapps/ShakeTestTool.iss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "ShakeTestTool"
5+
#define MyAppVersion "1.3"
6+
#define MyAppPublisher "liqinxing, Inc."
7+
#define MyAppURL "https://www.qinxing.xyz/"
8+
#define MyAppExeName "ShakeTestTool.exe"
9+
10+
[Setup]
11+
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
12+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13+
AppId={{12F34F85-9D0D-4F1B-9492-E8875EE23A31}
14+
AppName={#MyAppName}
15+
AppVersion={#MyAppVersion}
16+
;AppVerName={#MyAppName} {#MyAppVersion}
17+
AppPublisher={#MyAppPublisher}
18+
AppPublisherURL={#MyAppURL}
19+
AppSupportURL={#MyAppURL}
20+
AppUpdatesURL={#MyAppURL}
21+
DefaultDirName=C:/ImageTools\{#MyAppName}
22+
DisableProgramGroupPage=yes
23+
; Uncomment the following line to run in non administrative install mode (install for current user only.)
24+
;PrivilegesRequired=lowest
25+
OutputDir=..\Output
26+
OutputBaseFilename={#MyAppName}
27+
SetupIconFile=..\ui\resource\main.ico
28+
Compression=lzma
29+
SolidCompression=yes
30+
WizardStyle=modern
31+
32+
[Languages]
33+
Name: "english"; MessagesFile: "compiler:Default.isl"
34+
35+
[Tasks]
36+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
37+
38+
[Files]
39+
Source: "..\dist\{#MyAppName}\{#MyAppName}.exe"; DestDir: "{app}"; Flags: ignoreversion
40+
Source: "..\dist\{#MyAppName}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
41+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
42+
43+
[Icons]
44+
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
45+
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
46+
47+
[Run]
48+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
49+

0 commit comments

Comments
 (0)