Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -52,26 +52,25 @@ def upload_files():
|
|
52 |
icon_file.save(icon_path)
|
53 |
|
54 |
# Construct the NSIS script with the correct paths
|
55 |
-
nsi_script = f"""
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
"""
|
75 |
|
76 |
nsi_path = os.path.join(app.config['UPLOAD_FOLDER'], 'installer.nsi')
|
77 |
with open(nsi_path, 'w') as nsi_file:
|
|
|
52 |
icon_file.save(icon_path)
|
53 |
|
54 |
# Construct the NSIS script with the correct paths
|
55 |
+
nsi_script = f"""!include nsDialogs.nsh
|
56 |
+
!include LogicLib.nsh
|
57 |
+
|
58 |
+
Outfile "output.exe"
|
59 |
+
InstallDir "$PROGRAMFILES\\YourApp"
|
60 |
+
|
61 |
+
Name "Your App"
|
62 |
+
Caption "Your App Installer"
|
63 |
+
VIProductVersion "1.0.0"
|
64 |
+
RequestExecutionLevel admin
|
65 |
+
|
66 |
+
Page instfiles
|
67 |
+
|
68 |
+
Section "Install"
|
69 |
+
SetOutPath "$INSTDIR"
|
70 |
+
File "{bat_path.replace('\\', '\\\\')}" # Escape backslashes for NSIS
|
71 |
+
File "{icon_path.replace('\\', '\\\\')}" # Escape backslashes for NSIS
|
72 |
+
SectionEnd
|
73 |
+
"""
|
|
|
74 |
|
75 |
nsi_path = os.path.join(app.config['UPLOAD_FOLDER'], 'installer.nsi')
|
76 |
with open(nsi_path, 'w') as nsi_file:
|