Skip to content

Commit

Permalink
fix sendto & gpu check
Browse files Browse the repository at this point in the history
  • Loading branch information
couleurm committed Feb 17, 2022
1 parent 5b43b4c commit f92146e
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions install/post.ps1
Original file line number Diff line number Diff line change
@@ -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")){
Expand Down Expand Up @@ -33,27 +35,25 @@ 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')
}

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


0 comments on commit f92146e

Please sign in to comment.