From f92146ebda9103c8d80febe1504bdefda861a625 Mon Sep 17 00:00:00 2001 From: Couleur <82747632+couleurm@users.noreply.github.com> Date: Thu, 17 Feb 2022 20:06:51 +0100 Subject: [PATCH] fix sendto & gpu check --- install/post.ps1 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/install/post.ps1 b/install/post.ps1 index 39aa0bc..4c77774 100644 --- a/install/post.ps1 +++ b/install/post.ps1 @@ -1,3 +1,5 @@ +$DIR = "C:\Users\WDAGUtilityAccount\scoop\apps\smoothie\current" + Rename-Item -Path (Convert-Path "$DIR\Smoothie*") -NewName "Smoothie" if (-Not(Test-Path "$ScoopDir\shims\sm.exe")){ @@ -33,7 +35,7 @@ Write-Warning "Testing FFmpeg encoders.. note NVENC may fail if you use an older $rc = (Get-Content "$DIR\Smoothie\settings\recipe.ini") -replace ('libx264 -preset slow -crf 15',$valid_args) -if ($valid_args -like '*libx26'){ +if ($valid_args -like "*libx26*"){ $rc = $rc -replace ('gpu=true','gpu=false') } @@ -41,19 +43,17 @@ Set-Content "$DIR\Smoothie\settings\recipe.ini" -Value $rc $SendTo = [System.Environment]::GetFolderPath('SendTo') -if (-Not(Test-Path "$Sendto\Smoothie.lnk")){ - - if (-Not(Test-Path "$DIR\sm.ico")){ - Invoke-WebRequest -UseBasicParsing https://cdn.discordapp.com/attachments/885925073851146310/940709737685725276/sm.ico -OutFile "$DIR\sm.ico" - } +Remove-Item "$SendTo\Smoothie.lnk" -Force -Ea Ignore - $WScriptShell = New-Object -ComObject WScript.Shell - $Shortcut = $WScriptShell.CreateShortcut("$SendTo\smoothie.lnk") - $Shortcut.TargetPath = "$DIR\VapourSynth\python.exe" - $Shortcut.Arguments = "$DIR\Smoothie\smoothie.py" - $Shortcut.IconLocation = "$DIR\sm.ico" - $Shortcut.Save() - - Rename-Item -Path "$SendTo\smoothie.lnk" -NewName 'Smoothie.lnk' # Shortcuts are always created in lowercase for some reason +if (-Not(Test-Path "$DIR\sm.ico")){ + Invoke-WebRequest -UseBasicParsing https://cdn.discordapp.com/attachments/885925073851146310/940709737685725276/sm.ico -OutFile "$DIR\sm.ico" } +$WScriptShell = New-Object -ComObject WScript.Shell +$Shortcut = $WScriptShell.CreateShortcut("$SendTo\smoothie.lnk") +$Shortcut.TargetPath = "$DIR\VapourSynth\python.exe" +$Shortcut.Arguments = "$DIR\Smoothie\smoothie.py -input" +$Shortcut.IconLocation = "$DIR\sm.ico" +$Shortcut.Save() +Rename-Item -Path "$SendTo\smoothie.lnk" -NewName 'Smoothie.lnk' # Shortcuts are always created in lowercase for some reason +