diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2024-06-04 21:20:40 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2024-06-04 21:20:40 +0900 |
| commit | 1aeda7350e54b1d629acbf52d05f67d52e02df9d (patch) | |
| tree | 5d8453c9aa21da961671801e17f07d5ac5210fd2 | |
| parent | 71af7d892a53bfc7d8b8c60e68e0964d1fc78a4d (diff) | |
Updates
| -rwxr-xr-x | public/thesiah-win.ps1 | 55 | ||||
| -rw-r--r-- | public/winprogs.csv | 9 | ||||
| -rwxr-xr-x | static/thesiah-win.ps1 | 55 | ||||
| -rw-r--r-- | static/winprogs.csv | 9 |
4 files changed, 128 insertions, 0 deletions
diff --git a/public/thesiah-win.ps1 b/public/thesiah-win.ps1 new file mode 100755 index 0000000..b7f8bee --- /dev/null +++ b/public/thesiah-win.ps1 @@ -0,0 +1,55 @@ +# Remote path to the CSV file +$csvUrl = "https://raw.githubusercontent.com/TheSiahxyz/THESIAH/main/static/winprogs.csv" +# Local temporary path for the CSV +$csvLocalPath = "C:\Temp\winprogs.csv" + +# Ensure the temp directory exists +if (-Not (Test-Path "C:\Temp")) { + New-Item -ItemType Directory -Path "C:\Temp" +} + +# Download the CSV file +Invoke-WebRequest -Uri $csvUrl -OutFile $csvLocalPath + +# Import the CSV and loop through each entry +$softwareList = Import-Csv -Path $csvLocalPath -Header "Type", "URL", "Description" +foreach ($software in $softwareList) { + if ($software.Type -eq "R") { + # Handle GitHub release (simple version: assume the latest release's .exe can be directly accessed via a predictable URL) + $latestReleaseUrl = "$($software.URL)/releases/latest/download/" + # Attempt to download from a constructed URL, assuming the repo uses this pattern + $url = Invoke-WebRequest -Uri $latestReleaseUrl -UseBasicParsing | Select-Object -ExpandProperty Links | Where-Object { $_.href -like "*.exe" } | Select-Object -First 1 -ExpandProperty href + } else { + # Direct download link handling + $url = $software.URL + } + + $localPath = "C:\Temp\App_Setup.exe" + + # Download the installer if a URL was found + if ($url -ne $null) { + Invoke-WebRequest -Uri $url -OutFile $localPath + + # Install the application silently + Start-Process -FilePath $localPath -Args "/S" -NoNewWindow -Wait + + # Remove the installer after installation + Remove-Item -Path $localPath -Force + + # Output which software has been installed + Write-Output "$($software.Description.trim()) has been installed successfully." + } else { + Write-Output "Failed to find download for $($software.Description.trim())." + } +} + +# Remove the CSV file after all installations +Remove-Item -Path $csvLocalPath -Force + +# Arch WSL +Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux +TAG=$(curl --silent "https://api.github.com/repos/yuk7/ArchWSL/releases/latest"|grep '"tag_name"'|sed -E 's/.*"([^"]+)".*/\1/'|sed 's/v//') +wget https://github.com/yuk7/ArchWSL/releases/download/$TAG/Arch.zip +unzip Arch.zip +cd Arch +./Arch.exe diff --git a/public/winprogs.csv b/public/winprogs.csv new file mode 100644 index 0000000..f1bc766 --- /dev/null +++ b/public/winprogs.csv @@ -0,0 +1,9 @@ +,"https://app-pc.kakaocdn.net/talk/win32/KakaoTalk_Setup.exe",is a Korean Mobile instant messenger. +R,"https://github.com/pbatard/rufus",is a utility that helps format and create bootable USB flash drives. +,"https://t1.kakaocdn.net/potplayer/PotPlayer/Version/Latest/PotPlayerSetup64.exe",is a versatile and powerful media player. +,"https://download.mozilla.org/?product=firefox-stub&os=win&lang=en-US",is a free and open-source web browser. +,"https://www.bandisoft.com/bandizip/dl.php?web",is a fast and easy archiver that supports compression and decompression. +R,"https://github.com/MarcGuiselin/wedge",is a tool to redirect bing and edge search engines. +,"https://mirror2.internetdownloadmanager.com/idman642build10.exe?v=lt&filename=idman642build10.exe",is a commercial download manager software application. +,"https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-user",is a lightweight but powerful code editor. +R,"https://github.com/the-via/releases",is a web app that lets you customize your keyboard. diff --git a/static/thesiah-win.ps1 b/static/thesiah-win.ps1 new file mode 100755 index 0000000..b7f8bee --- /dev/null +++ b/static/thesiah-win.ps1 @@ -0,0 +1,55 @@ +# Remote path to the CSV file +$csvUrl = "https://raw.githubusercontent.com/TheSiahxyz/THESIAH/main/static/winprogs.csv" +# Local temporary path for the CSV +$csvLocalPath = "C:\Temp\winprogs.csv" + +# Ensure the temp directory exists +if (-Not (Test-Path "C:\Temp")) { + New-Item -ItemType Directory -Path "C:\Temp" +} + +# Download the CSV file +Invoke-WebRequest -Uri $csvUrl -OutFile $csvLocalPath + +# Import the CSV and loop through each entry +$softwareList = Import-Csv -Path $csvLocalPath -Header "Type", "URL", "Description" +foreach ($software in $softwareList) { + if ($software.Type -eq "R") { + # Handle GitHub release (simple version: assume the latest release's .exe can be directly accessed via a predictable URL) + $latestReleaseUrl = "$($software.URL)/releases/latest/download/" + # Attempt to download from a constructed URL, assuming the repo uses this pattern + $url = Invoke-WebRequest -Uri $latestReleaseUrl -UseBasicParsing | Select-Object -ExpandProperty Links | Where-Object { $_.href -like "*.exe" } | Select-Object -First 1 -ExpandProperty href + } else { + # Direct download link handling + $url = $software.URL + } + + $localPath = "C:\Temp\App_Setup.exe" + + # Download the installer if a URL was found + if ($url -ne $null) { + Invoke-WebRequest -Uri $url -OutFile $localPath + + # Install the application silently + Start-Process -FilePath $localPath -Args "/S" -NoNewWindow -Wait + + # Remove the installer after installation + Remove-Item -Path $localPath -Force + + # Output which software has been installed + Write-Output "$($software.Description.trim()) has been installed successfully." + } else { + Write-Output "Failed to find download for $($software.Description.trim())." + } +} + +# Remove the CSV file after all installations +Remove-Item -Path $csvLocalPath -Force + +# Arch WSL +Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux +TAG=$(curl --silent "https://api.github.com/repos/yuk7/ArchWSL/releases/latest"|grep '"tag_name"'|sed -E 's/.*"([^"]+)".*/\1/'|sed 's/v//') +wget https://github.com/yuk7/ArchWSL/releases/download/$TAG/Arch.zip +unzip Arch.zip +cd Arch +./Arch.exe diff --git a/static/winprogs.csv b/static/winprogs.csv new file mode 100644 index 0000000..f1bc766 --- /dev/null +++ b/static/winprogs.csv @@ -0,0 +1,9 @@ +,"https://app-pc.kakaocdn.net/talk/win32/KakaoTalk_Setup.exe",is a Korean Mobile instant messenger. +R,"https://github.com/pbatard/rufus",is a utility that helps format and create bootable USB flash drives. +,"https://t1.kakaocdn.net/potplayer/PotPlayer/Version/Latest/PotPlayerSetup64.exe",is a versatile and powerful media player. +,"https://download.mozilla.org/?product=firefox-stub&os=win&lang=en-US",is a free and open-source web browser. +,"https://www.bandisoft.com/bandizip/dl.php?web",is a fast and easy archiver that supports compression and decompression. +R,"https://github.com/MarcGuiselin/wedge",is a tool to redirect bing and edge search engines. +,"https://mirror2.internetdownloadmanager.com/idman642build10.exe?v=lt&filename=idman642build10.exe",is a commercial download manager software application. +,"https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-user",is a lightweight but powerful code editor. +R,"https://github.com/the-via/releases",is a web app that lets you customize your keyboard. |
