Fixed KVRT not launching due to the application hard-coding the default data folder to C:

This commit is contained in:
Homes32
2025-05-26 19:49:53 -05:00
parent fcd79a71b0
commit 8766122c2e

View File

@@ -35,13 +35,16 @@ Author=Homes32
Level=5 Level=5
Selected=False Selected=False
Mandatory=False Mandatory=False
Version=1.0.3.0 Version=1.1.0.0
Date=2024-10-14 Date=2025-05-26
[Variables] [Variables]
%ProgramFolder%="Kaspersky Virus Removal Tool" %ProgramFolder%="Kaspersky Virus Removal Tool"
%ProgramExe%="KVRT.exe" %ProgramExe%="KVRT.exe"
// Kaspersky hard-codes the default data dir to C: so we need to redirect it to %Temp%
%ProgramArgs%="-d #$q#$pTemp#$p\KVRT#$q -moddirpath #$q#$pTemp#$p\KVRT\Bin#$q -accepteula -noads -fixednames -dontencrypt -details"
%DownloadURL%=https://devbuilds.s.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe %DownloadURL%=https://devbuilds.s.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe
%DownloadURL_Alt%=https://files04.tchspt.com/down/KVRT.exe
[Process] [Process]
Echo,"Processing %ScriptTitle%..." Echo,"Processing %ScriptTitle%..."
@@ -59,8 +62,8 @@ Echo,"Program version: v%ProgramExeVer%"
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Shortcuts // Shortcuts
If,%cb_DesktopShc%,Equal,True,AddShortcut,Desktop,"",%txt_ShortcutName%,"%PEPrograms%\%ProgramFolder%\%ProgramExe%","","%PEPrograms%\%ProgramFolder%" If,%cb_DesktopShc%,Equal,True,AddShortcut,Desktop,"",%txt_ShortcutName%,"%PEPrograms%\%ProgramFolder%\%ProgramExe%",%ProgramArgs%,"%PEPrograms%\%ProgramFolder%"
If,%cb_StartMenuShc%,Equal,True,AddShortcut,StartMenu,%txt_StartMenuFolder%,%txt_ShortcutName%,"%PEPrograms%\%ProgramFolder%\%ProgramExe%","","%PEPrograms%\%ProgramFolder%" If,%cb_StartMenuShc%,Equal,True,AddShortcut,StartMenu,%txt_StartMenuFolder%,%txt_ShortcutName%,"%PEPrograms%\%ProgramFolder%\%ProgramExe%",%ProgramArgs%,"%PEPrograms%\%ProgramFolder%"
If,%cb_PinToTaskbar%,Equal,True,PinShortcut,Taskbar,Auto,"%PEPrograms%\%ProgramFolder%\%ProgramExe%" If,%cb_PinToTaskbar%,Equal,True,PinShortcut,Taskbar,Auto,"%PEPrograms%\%ProgramFolder%\%ProgramExe%"
If,%cb_PinToStartMenu%,Equal,True,PinShortcut,StartMenu,Auto,"%PEPrograms%\%ProgramFolder%\%ProgramExe%" If,%cb_PinToStartMenu%,Equal,True,PinShortcut,StartMenu,Auto,"%PEPrograms%\%ProgramFolder%\%ProgramExe%"
@@ -78,7 +81,12 @@ If,%cb_PinToStartMenu%,Equal,True,PinShortcut,StartMenu,Auto,"%PEPrograms%\%Prog
[DownloadProgram] [DownloadProgram]
Echo,"Downloading %ScriptTitle%..." Echo,"Downloading %ScriptTitle%..."
WebGet,%DownloadURL%,"%ProgramsCache%\%ProgramFolder%\%ProgramExe%",NOERR WebGet,%DownloadURL%,"%ProgramsCache%\%ProgramFolder%\%ProgramExe%",NOERR
If,Not,#r,Equal,200,Halt,"Download [%ProgramExe%] failed: The code returned was [#r]." If,Not,#r,Equal,200,Begin
Echo,"Download [%ProgramExe%] from main URL failed: The code returned was [#r]. Note: KRVT downloads from Kaspersky are blocked in the US.",Warn
Echo,"Attempting to download %ScriptTitle% from an alternate source..."
WebGetEx,%DownloadURL_Alt%,"%ProgramsCache%\%ProgramFolder%\%ProgramExe%","Referer=https://www.techspot.com/","UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.7151 Safari/537.36 Edge/16.16299",NOERR
If,Not,#r,Equal,0,Halt,"Download [%ProgramExe%] failed: The code returned was [#r]. See log for details."
End
[#LaunchProgram#] [#LaunchProgram#]
// =============================================================================================================================== // ===============================================================================================================================