From c2c7efe0eeb77fe875f171e1692ae39965db0d5d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 13 Sep 2023 12:01:12 +0200 Subject: [PATCH 1/4] Fix Discord startup --- windows/vencord_installer.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/vencord_installer.bat b/windows/vencord_installer.bat index 152d104..cb30bee 100644 --- a/windows/vencord_installer.bat +++ b/windows/vencord_installer.bat @@ -13,7 +13,7 @@ PowerShell -Command "$link = 'https://github.com/Vencord/Installer/releases/late IF NOT "%1"=="yes" ( :: Restart Discord - "%LOCALAPPDATA%\Discord\Update.exe" + PowerShell Start-Process "%LOCALAPPDATA%\Discord\app-*\Discord.exe" PAUSE ) From b88d74ea96b954e7f53bb689b2a16f0d34b37caf Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 13 Sep 2023 12:03:52 +0200 Subject: [PATCH 2/4] reduce line size Using "" ^ for Powershell commands --- windows/blockthespot.bat | 27 ++++++++++++++------------- windows/fix_obs_shortcut.bat | 13 +++++++------ windows/vencord_installer.bat | 13 +++++++------ 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/windows/blockthespot.bat b/windows/blockthespot.bat index bbb0b92..e628778 100644 --- a/windows/blockthespot.bat +++ b/windows/blockthespot.bat @@ -9,19 +9,20 @@ PowerShell -Command "Stop-Process -Name Spotify -ErrorAction SilentlyContinue" :: Patch spotify ECHO Patch spotify avec BlockTheSpot -PowerShell -Command "cd $HOME;" ^ - "$url_elf = 'https://github.com/mrpond/BlockTheSpot/releases/latest/download/chrome_elf.zip';" ^ - "$dest_elf = Join-Path -Path $PWD -ChildPath 'chrome_elf.zip';" ^ - "$spotifyDirectory = Join-Path -Path $env:APPDATA -ChildPath 'Spotify';" ^ - "$spotifyExecutable = Join-Path -Path $spotifyDirectory -ChildPath 'Spotify.exe';" ^ - "Invoke-WebRequest -Uri $url_elf -OutFile $dest_elf;" ^ - "Expand-Archive -Force -LiteralPath $dest_elf -DestinationPath $PWD | Wait-Process;" ^ - "Remove-Item -LiteralPath $dest_elf -Force;" ^ - "$patchFiles = (Join-Path -Path $PWD -ChildPath 'dpapi.dll')," ^ - "(Join-Path -Path $PWD -ChildPath 'config.ini');" ^ - "Copy-Item -LiteralPath $patchFiles -Destination $spotifyDirectory;" ^ - "Remove-Item -LiteralPath $patchFiles;" ^ - "Start-Process -WorkingDirectory $spotifyDirectory -FilePath $spotifyExecutable" +PowerShell -Command "" ^ + "cd $HOME;" ^ + "$url_elf = 'https://github.com/mrpond/BlockTheSpot/releases/latest/download/chrome_elf.zip';" ^ + "$dest_elf = Join-Path -Path $PWD -ChildPath 'chrome_elf.zip';" ^ + "$spotifyDirectory = Join-Path -Path $env:APPDATA -ChildPath 'Spotify';" ^ + "$spotifyExecutable = Join-Path -Path $spotifyDirectory -ChildPath 'Spotify.exe';" ^ + "Invoke-WebRequest -Uri $url_elf -OutFile $dest_elf;" ^ + "Expand-Archive -Force -LiteralPath $dest_elf -DestinationPath $PWD | Wait-Process;" ^ + "Remove-Item -LiteralPath $dest_elf -Force;" ^ + "$patchFiles = (Join-Path -Path $PWD -ChildPath 'dpapi.dll')," ^ + "(Join-Path -Path $PWD -ChildPath 'config.ini');" ^ + "Copy-Item -LiteralPath $patchFiles -Destination $spotifyDirectory;" ^ + "Remove-Item -LiteralPath $patchFiles;" ^ + "Start-Process -WorkingDirectory $spotifyDirectory -FilePath $spotifyExecutable" :: Delete newly created Spotify shortcut DEL %HOMEPATH%\Desktop\Spotify.lnk 2>NUL diff --git a/windows/fix_obs_shortcut.bat b/windows/fix_obs_shortcut.bat index a509511..07a745a 100644 --- a/windows/fix_obs_shortcut.bat +++ b/windows/fix_obs_shortcut.bat @@ -8,12 +8,13 @@ fltmc >NUL 2>&1 || ( EXIT 0 ) -PowerShell -Command "$WshShell = New-Object -COM WScript.Shell;" ^ - "$Shortcut = $WshShell.CreateShortcut('%ProgramData%\Microsoft\Windows\Start Menu\Programs\OBS Studio\OBS Studio (64bit).lnk');" ^ - "$Shortcut.TargetPath = '%ProgramFiles%\obs-studio\bin\64bit\obs64.exe';" ^ - "$Shortcut.WorkingDirectory = '%ProgramFiles%\obs-studio\bin\64bit';" ^ - "$Shortcut.Arguments = '--profile ""ANRI GAMING (PROFIL)"""" --multi';" ^ - "$Shortcut.Save()" +PowerShell -Command "" ^ + "$WshShell = New-Object -COM WScript.Shell;" ^ + "$Shortcut = $WshShell.CreateShortcut('%ProgramData%\Microsoft\Windows\Start Menu\Programs\OBS Studio\OBS Studio (64bit).lnk');" ^ + "$Shortcut.TargetPath = '%ProgramFiles%\obs-studio\bin\64bit\obs64.exe';" ^ + "$Shortcut.WorkingDirectory = '%ProgramFiles%\obs-studio\bin\64bit';" ^ + "$Shortcut.Arguments = '--profile ""ANRI GAMING (PROFIL)"""" --multi';" ^ + "$Shortcut.Save()" IF NOT "%1"=="yes" PAUSE EXIT /B diff --git a/windows/vencord_installer.bat b/windows/vencord_installer.bat index cb30bee..c7e6f3c 100644 --- a/windows/vencord_installer.bat +++ b/windows/vencord_installer.bat @@ -4,12 +4,13 @@ ECHO Ferme Discord TASKKILL /im Discord.exe /F ECHO Installe Vencord -PowerShell -Command "$link = 'https://github.com/Vencord/Installer/releases/latest/download/VencordInstallerCli.exe';" ^ - "$file = 'vencord.exe';" ^ - "$outfile = Join-Path -Path $env:TEMP -ChildPath $file;" ^ - "Invoke-WebRequest -Uri $link -OutFile $outfile;" ^ - "cd $env:TEMP;" ^ - "ECHO 1| & $outfile -install" +PowerShell -Command "" ^ + "$link = 'https://github.com/Vencord/Installer/releases/latest/download/VencordInstallerCli.exe';" ^ + "$file = 'vencord.exe';" ^ + "$outfile = Join-Path -Path $env:TEMP -ChildPath $file;" ^ + "Invoke-WebRequest -Uri $link -OutFile $outfile;" ^ + "cd $env:TEMP;" ^ + "ECHO 1| & $outfile -install" IF NOT "%1"=="yes" ( :: Restart Discord From 6f443454f51d2718b63b473c51bd0cd7d6d49872 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 13 Sep 2023 12:04:48 +0200 Subject: [PATCH 3/4] don't download fix_obs_shortcut --- windows11.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows11.bat b/windows11.bat index 04cb479..c06f956 100644 --- a/windows11.bat +++ b/windows11.bat @@ -204,7 +204,7 @@ PowerShell -Command "Install-Module -Name PSWindowsUpdate -Force" PowerShell -Command "Invoke-WebRequest -Uri !repo!/windows/ctmpf.bat -OutFile '%HOMEPATH%\Documents\Local\ctmpf.bat'" PowerShell -Command "Invoke-WebRequest -Uri !repo!/windows/update.bat -OutFile '%HOMEPATH%\Documents\Local\update.bat'" PowerShell -Command "Invoke-WebRequest -Uri !repo!/windows/fix_nvidia_wsl.bat -OutFile '%HOMEPATH%\Documents\Local\fix_nvidia_wsl.bat'" -PowerShell -Command "Invoke-WebRequest -Uri !repo!/windows/fix_obs_shortcut.bat -OutFile '%HOMEPATH%\Documents\Local\fix_obs_shortcut.bat'" +:: PowerShell -Command "Invoke-WebRequest -Uri !repo!/windows/fix_obs_shortcut.bat -OutFile '%HOMEPATH%\Documents\Local\fix_obs_shortcut.bat'" PowerShell -Command "Invoke-WebRequest -Uri !repo!/windows/vencord_installer.bat -OutFile '%HOMEPATH%\Documents\Local\vencord_installer.bat'" :: === Install Vencord == From 22837c08647b6b6159cdda4abf93932f3226d2d4 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 13 Sep 2023 12:05:44 +0200 Subject: [PATCH 4/4] Add vencord_installer sync --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 02bc07e..19c6c3c 100644 --- a/Makefile +++ b/Makefile @@ -125,10 +125,11 @@ sync-wsl: # Windows through WSL sync-windows: # Scripts - @$(WGET) $(REPO_SRC)/windows/ctmpf.bat -O $(WIN_HOME)/Documents/Local/ctmpf.bat @$(WGET) $(REPO_SRC)/windows/blockthespot.bat -O $(WIN_HOME)/Documents/Local/blockthespot.bat + @$(WGET) $(REPO_SRC)/windows/ctmpf.bat -O $(WIN_HOME)/Documents/Local/ctmpf.bat @$(WGET) $(REPO_SRC)/windows/update.bat -O $(WIN_HOME)/Documents/Local/update.bat @$(WGET) $(REPO_SRC)/windows/fix_nvidia_wsl.bat -O $(WIN_HOME)/Documents/Local/fix_nvidia_wsl.bat + @$(WGET) $(REPO_SRC)/windows/vencord_installer.bat -O $(WIN_HOME)/Documents/Local/vencord_installer.bat @echo "(Windows) Scripts synced!" @echo