Add CCPCryptFS Install.ps1

This commit is contained in:
2024-03-01 16:12:25 +00:00
parent 6c732aee22
commit 8692860087

26
CCPCryptFS Install.ps1 Normal file
View File

@@ -0,0 +1,26 @@
$releaseURL = "https://api.github.com/repos/bailey27/cppcryptfs/releases/latest"
$installPath = "C:\Program Files\CCPCryptFS"
$release = Invoke-RestMethod $releaseURL
$latestVersion = $release.tag_name
write-host "Latest Version: $latestVersion"
new-item -type Directory $installPath -force | out-null
foreach ($asset in $release.assets) {
$fileName = $asset.name
$downloadURL = $asset.browser_download_url
if ($fileName -like '*32.exe') {
continue
}
Invoke-WebRequest -URI $downloadURL -OutFile "$installPath\$fileName"
if ($fileName -like 'cppcryptfs.exe') {
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\$((Get-Item "$installPath\$fileName").Basename).lnk")
$Shortcut.TargetPath = "$installPath\$fileName"
$Shortcut.Save()
}
}