feat: WinImage 9.0
- extract zip to tools directory, add batch file
This commit is contained in:
38
WinImage/tools/chocolateyInstall.ps1
Normal file
38
WinImage/tools/chocolateyInstall.ps1
Normal file
@@ -0,0 +1,38 @@
|
||||
$package = 'WinImage'
|
||||
$version = '90'
|
||||
|
||||
try {
|
||||
$params = @{
|
||||
PackageName = $package;
|
||||
FileType = 'zip';
|
||||
Url = "http://www.winimage.com/download/winima$version.zip";
|
||||
Url64Bit = "http://www.winimage.com/download/wima64$version.zip";
|
||||
UnzipLocation = Join-Path $Env:SystemDrive 'tools';
|
||||
}
|
||||
|
||||
$binRoot = Join-Path $Env:SystemDrive $Env:Chocolatey_Bin_Root
|
||||
if (Test-Path $binRoot)
|
||||
{
|
||||
$params.UnzipLocation = $binRoot
|
||||
}
|
||||
|
||||
$params.UnzipLocation = Join-Path $params.UnzipLocation $package
|
||||
|
||||
if (!(Test-Path($params.UnzipLocation)))
|
||||
{
|
||||
New-Item $params.UnzipLocation -Type Directory | Out-Null
|
||||
}
|
||||
|
||||
Install-ChocolateyZipPackage @params
|
||||
|
||||
Get-ChildItem $params.UnzipLocation -Filter *.exe -Recurse |
|
||||
? { $_.Name -match 'winimage' } |
|
||||
% {
|
||||
Generate-BinFile ($_.Name -replace '\.exe', '') $_.FullName
|
||||
}
|
||||
|
||||
Write-ChocolateySuccess $package
|
||||
} catch {
|
||||
Write-ChocolateyFailure $package "$($_.Exception.Message)"
|
||||
throw
|
||||
}
|
25
WinImage/tools/chocolateyUninstall.ps1
Normal file
25
WinImage/tools/chocolateyUninstall.ps1
Normal file
@@ -0,0 +1,25 @@
|
||||
$package = 'WinImage'
|
||||
|
||||
try {
|
||||
$location = Join-Path $Env:SystemDrive $Env:Chocolatey_Bin_Root
|
||||
if (!(Test-Path $location))
|
||||
{
|
||||
$location = Join-Path $Env:SystemDrive 'tools'
|
||||
}
|
||||
$location = Join-Path $location $package
|
||||
|
||||
Remove-Item $location -Recurse -Force
|
||||
|
||||
Push-Location $Env:ChocolateyInstall\bin
|
||||
$batch = 'winimage.bat'
|
||||
if (Test-Path $batch)
|
||||
{
|
||||
Remove-Item $batch
|
||||
}
|
||||
Pop-Location
|
||||
|
||||
Write-ChocolateySuccess $package
|
||||
} catch {
|
||||
Write-ChocolateyFailure $package "$($_.Exception.Message)"
|
||||
throw
|
||||
}
|
Reference in New Issue
Block a user