I have a setup script, and for some reason it's not downloading the specified file (at the end of the script, using the URLDownloadToFile command).
Below is the code:
Code: Select all
#SingleInstance Force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%
full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
try
{
if A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
loading := "C:\Users\benri\OneDrive\Desktop\My Files\Logos, Loaders, Icons, and Home Screens\Loaders\ajax-loader_002.gif"
Gui, WelcomeGUI:Add, Text,, Hi!
Gui, WelcomeGUI:Add, Text,, Welcome to the Formal Software Download Assistant.
Gui, WelcomeGUI:Add, Text,, To continue, click the NEXT button. To cancel this process, click the ABORT button.
Gui, WelcomeGUI:Add, Picture, w200 h-1 gBack, %A_ScriptDir%\Back.png
Gui, WelcomeGUI:Add, Picture, w200 h-1 ym gNext, %A_ScriptDir%\Next.png
Gui, WelcomeGUI:Show
Gui, Load:-Caption +Toolwindow +Alwaysontop
Gui, Load:Add, ActiveX, w120 h150, % "mshtml:<img src='" loading "' />"
Sleep, 2000
Gui, Load:Destroy
Gui, ChooseAppGUI:Add, Text,, Select the Formal Software products you want to install.
Gui, ChooseAppGUI:Add, Checkbox, Checked vInstTexType, TexType
Gui, ChooseAppGUI:Add, Checkbox, Checked vInstMathMadeEasy, Math Made Easy Package
Gui, ChooseAppGUI:Add, Button, Default vDownload, Done
Gui, ChooseAppGUI:Show ; Show the window.
return
Back:
ExitApp
Next:
Gui, WelcomeGUI:Destroy
Gui, Load:Show
return
ChooseAppGUIButtonDone:
Switch vInstTexType
{
Case 1: MsgBox Done?
FileCreateDir, %A_ProgramFiles%\Formal Software\TexType\Installer files
URLDownloadToFile, https://1drv.ms/u/s!AssKrEUmq8NO1Ft2vra8EUxyVQ1y?e=MJJrRl, %A_ProgramFiles%\Formal Software\TexType\Installer files\TexType 1.1.exe ; Install TexType.
MsgBox, Downloaded!
Case 0: return ; Do not install TexType.
}
ExitApp
Can someone help me with this issue?