-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_tool_python.iss
More file actions
97 lines (86 loc) · 3.42 KB
/
Copy pathsetup_tool_python.iss
File metadata and controls
97 lines (86 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
; Non-commercial use only
#define MyAppName "Python Tool for CLCL Clipboard manager"
#define MyAppVersion "1.0"
#define MyAppPublisher "Wilf Zimmermann"
#define MyAppURL "https://www.linguversa.de/"
[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={{9B260BF3-3BFC-44BB-B29C-F3ED99ACD537}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={commonpf32}\CLCL
ArchiveExtraction=full
; Use "ArchiveExtraction=enhanced" if all your archives are .7z files
; Use "ArchiveExtraction=enhanced/nopassword" if all your archives are not password-protected
DefaultGroupName=CLCL
AllowNoIcons=yes
; LicenseFile=LICENSE.txt
; Uncomment the following line to run in non administrative install mode (install for current user only).
;PrivilegesRequired=lowest
OutputDir=setup
OutputBaseFilename=setup_tool_python
; SetupIconFile=res\icon1.ico
SolidCompression=yes
WizardStyle=modern dynamic
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
[Files]
Source: "Release\tool_python.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "python314.*"; DestDir: "{app}"; Flags: ignoreversion
Source: "https://www.python.org/ftp/python/3.14.7/python-3.14.7-embed-win32.zip"; DestDir: "{app}\python314"; DestName: "python_embed_win32.zip"; ExternalSize: "11534336"; Flags: ignoreversion external download extractarchive recursesubdirs createallsubdirs
[Code]
procedure ExtractAndCopyPython;
var
ZipPath: String;
AppDir: String;
SourceFile: String;
DestFile: String;
begin
ZipPath := ExpandConstant('{tmp}\python314.zip');
AppDir := ExpandConstant('{app}');
{ Copy specific DLLs from python314 subfolder to app root }
SourceFile := AppDir + '\python314\python3.dll';
DestFile := AppDir + '\python3.dll';
if FileExists(SourceFile) then
begin
{ Delete destination file if it exists }
if FileExists(DestFile) then
DeleteFile(DestFile);
if not CopyFile(SourceFile, DestFile, True) then
MsgBox('Failed to copy python3.dll', mbError, MB_OK);
end
else
MsgBox('python3.dll not found in extracted archive', mbInformation , MB_OK);
SourceFile := AppDir + '\python314\python314.dll';
DestFile := AppDir + '\python314.dll';
if FileExists(SourceFile) then
begin
{ Delete destination file if it exists }
if FileExists(DestFile) then
DeleteFile(DestFile);
if not CopyFile(SourceFile, DestFile, True) then
MsgBox('Failed to copy python314.dll', mbError, MB_OK);
end
else
MsgBox('python314.dll not found in extracted archive', mbInformation , MB_OK);
{ Clean up temp directory }
{ DelTree(TempDir, True, True, True); }
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
ExtractAndCopyPython;
end;
end;