fix shortcut creation

This commit is contained in:
Mylloon 2024-04-18 01:34:33 +02:00
parent 6a15347a9e
commit 48f9199eed
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -2,22 +2,28 @@
SETLOCAL ENABLEDELAYEDEXPANSION SETLOCAL ENABLEDELAYEDEXPANSION
SET "collapse=%ProgramFiles%\Collapse Launcher" SET "collapse=%ProgramFiles%\Collapse Launcher"
FOR /F %%i IN ('dir /B /S ^"!collapse!\app-*^"') DO SET "vbc=%%i" SET "exe=CollapseLauncher.exe"
FOR /F "usebackq delims=" %%i IN (`dir /B /S "!collapse!\app-*"`) DO SET "vbc=%%i"
SET "iconpath=Assets\Images\GameIcon"
:: Genshin shortcut :: Genshin shortcut
ECHO Genshin shortcut creation...
PowerShell -Command "" ^ PowerShell -Command "" ^
"$WshShell = New-Object -comObject WScript.Shell;" ^ "$WshShell = New-Object -comObject WScript.Shell;" ^
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\Genshin Impact.lnk');" ^ "$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\Genshin Impact.lnk');" ^
"$Shortcut.WorkingDirectory = '!collapse!';" ^ "$Shortcut.TargetPath = '!collapse!\!exe!';" ^
"$Shortcut.TargetPath = '!collapse!\CollapseLauncher.exe open -g 1 -r 0';" ^ "$Shortcut.Arguments = 'open -g 1 -r 0';" ^
"$Shortcut.IconLocation = '!vbc!\!iconpath!\icon-genshin.ico';" ^
"$Shortcut.Save()" "$Shortcut.Save()"
:: Honkai shortcut :: Honkai shortcut
ECHO Honkai shortcut creation...
PowerShell -Command "" ^ PowerShell -Command "" ^
"$WshShell = New-Object -comObject WScript.Shell;" ^ "$WshShell = New-Object -comObject WScript.Shell;" ^
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\Genshin Impact.lnk');" ^ "$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\Honkai Star Rail.lnk');" ^
"$Shortcut.WorkingDirectory = '!collapse!';" ^ "$Shortcut.TargetPath = '!collapse!\!exe!';" ^
"$Shortcut.TargetPath = '!collapse!\CollapseLauncher.exe open -g 2 -r 0';" ^ "$Shortcut.Arguments = 'open -g 2 -r 0';" ^
"$Shortcut.IconLocation = '!vbc!\!iconpath!\icon-icon-starrail.ico';" ^
"$Shortcut.Save()" "$Shortcut.Save()"
IF NOT "%1"=="yes" PAUSE IF NOT "%1"=="yes" PAUSE