Browse Source

Fix up BlueBrick 1.9.0 installation

Douglas Thrift 3 years ago
parent
commit
2a13b8b7e1

+ 3 - 3
automatic/bluebrick/bluebrick.nuspec

@@ -3,7 +3,7 @@
   <metadata>
     <id>bluebrick</id>
     <version>1.9.0</version>
-    <packageSourceUrl>https://github.com/douglaswth/chocolatey-packages/tree/master/manual/bluebrick</packageSourceUrl>
+    <packageSourceUrl>https://github.com/douglaswth/chocolatey-packages/tree/master/automatic/bluebrick</packageSourceUrl>
     <owners>Douglas Thrift</owners>
     <title>BlueBrick</title>
     <authors>Alban Nanty</authors>
@@ -12,8 +12,8 @@
     <copyright>2010 Alban Nanty</copyright>
     <licenseUrl>https://www.gnu.org/licenses/gpl.html</licenseUrl>
     <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <projectSourceUrl>https://bitbucket.org/banban/bluebrick</projectSourceUrl>
-    <bugTrackerUrl>https://bitbucket.org/banban/bluebrick/issues?status=new&amp;status=open</bugTrackerUrl>
+    <projectSourceUrl>https://github.com/Lswbanban/BlueBrick</projectSourceUrl>
+    <bugTrackerUrl>https://github.com/Lswbanban/BlueBrick/issues</bugTrackerUrl>
     <tags>bluebrick lego layout</tags>
     <summary>LEGO® Layout Editor</summary>
     <description>

+ 7 - 6
automatic/bluebrick/tools/chocolateyinstall.ps1

@@ -1,16 +1,16 @@
 $ErrorActionPreference = 'Stop';
 
 $packageName = $env:ChocolateyPackageName
-$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
-$blueBrickExe = Join-Path $toolsDir 'BlueBrick.exe'
+$installDir = Join-Path (Get-ToolsLocation) 'bluebrick'
+$blueBrickExe = Join-Path $installDir 'BlueBrick.exe'
 $blueBrickLnk = Join-Path ([System.Environment]::GetFolderPath('CommonPrograms')) 'BlueBrick.lnk'
 
 $packageArgs = @{
   packageName   = $packageName
-  unzipLocation = $toolsDir
-  url           = 'https://bluebrick.lswproject.com/download/BlueBrick.1.9.0.zip'       # BlueBrick
-  checksum      = 'e94924e9d0e529ee65990615429deda927923f8b65852205ebe4ef78bd53d820'    # BlueBrick
-  checksumType  = 'sha256'                                                              # BlueBrick
+  unzipLocation = $installDir
+  url           = 'https://bluebrick.lswproject.com/download/BlueBrick.1.9.0.zip'
+  checksum      = 'e94924e9d0e529ee65990615429deda927923f8b65852205ebe4ef78bd53d820'
+  checksumType  = 'sha256'
 }
 
 Install-ChocolateyZipPackage @packageArgs
@@ -18,3 +18,4 @@ Install-ChocolateyShortcut `
   -ShortcutFilePath $blueBrickLnk `
   -TargetPath $blueBrickExe `
   -Description 'Plan LEGO® Layout with BlueBrick'
+Install-BinFile -Name BlueBrick -Path $blueBrickExe -UseStart

+ 5 - 1
automatic/bluebrick/tools/chocolateyuninstall.ps1

@@ -1,5 +1,9 @@
 $ErrorActionPreference = 'Stop';
 
+$installDir = Join-Path (Get-ToolsLocation) 'bluebrick'
+$blueBrickExe = Join-Path $installDir 'BlueBrick.exe'
 $blueBrickLnk = Join-Path ([System.Environment]::GetFolderPath('CommonPrograms')) 'BlueBrick.lnk'
 
-Remove-Item -Path $blueBrickLnk -Force | Out-Null
+Uninstall-BinFile -Name BlueBrick -Path $blueBrickExe
+Remove-Item -Path $blueBrickLnk -Force
+Remove-Item -Path $installDir -Recurse -Force

+ 3 - 3
automatic/bluebrick/update.ps1

@@ -14,9 +14,9 @@ function global:au_GetLatest {
 function global:au_SearchReplace {
     @{
         'tools\chocolateyInstall.ps1' = @{
-            "(\s+url\s+=\s+)('.*')(\s+#\sBlueBrick)"          = "`$1'$($Latest.URL32)'`$3"
-            "(\s+checksum\s+=\s+)('.*')(\s+#\sBlueBrick)"     = "`$1'$($Latest.Checksum32)'`$3"
-            "(\s+checksumType\s+=\s+)('.*')(\s+#\sBlueBrick)" = "`$1'$($Latest.ChecksumType32)'`$3"
+            "(\s+url\s+=\s+)('.*')"          = "`$1'$($Latest.URL32)'"
+            "(\s+checksum\s+=\s+)('.*')"     = "`$1'$($Latest.Checksum32)'"
+            "(\s+checksumType\s+=\s+)('.*')" = "`$1'$($Latest.ChecksumType32)'"
         }
     }
 }