From 9b13e4c80c12ca74046a9433b996df6591422696 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 16 Dec 2024 13:29:26 -0500 Subject: [PATCH] cricut-design-space: Extract files directly instead of running installer --- .../tools/chocolateyinstall.ps1 | 47 ++++++++----------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/cricut-design-space/tools/chocolateyinstall.ps1 b/cricut-design-space/tools/chocolateyinstall.ps1 index 53cd433..d9feadd 100644 --- a/cricut-design-space/tools/chocolateyinstall.ps1 +++ b/cricut-design-space/tools/chocolateyinstall.ps1 @@ -1,39 +1,30 @@ $ErrorActionPreference = 'Stop'; -$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" - +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$installDir = "C:\Program Files (x86)\Cricut Design Space\" $packageArgs = @{ packageName = $env:ChocolateyPackageName - unzipLocation = $toolsDir - fileType = 'EXE' File = '\\ucs\software\CricutDesignSpace-Install-v8.60.67.exe' - - softwareName = 'cricutdesignspace*' - - checksum = '78b04935a1be4cef0e9f690a75b53c86c5783d8491760a5dada709544cf25d0c' - checksumType = 'sha256' - - silentArgs = '/S' - validExitCodes= @(0) + Checksum = '78b04935a1be4cef0e9f690a75b53c86c5783d8491760a5dada709544cf25d0c' + ChecksumType = 'sha256' + UnzipLocation = $toolsDir } -Install-ChocolateyPackage @packageArgs - - - - - - - - - - - - - - - +Install-ChocolateyZipPackage @packageArgs +$innerPackageArgs = @{ + File = "$(Join-Path $toolsDir '$PLUGINSDIR/app-32.7z')" + Destination = $installDir +} +Get-ChocolateyUnzip @innerPackageArgs +$shortcutArgs = @{ + ShortcutFilePath = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cricut Design Space.lnk" + TargetPath = "$(Join-Path $installDir 'Cricut Design Space.exe')" + WorkingDirectory = $installDir + IconLocation = "$(Join-Path $installDir 'Cricut Design Space.exe')" + Description = "Cricut Design Space Application" +} +Install-ChocolateyShortcut @shortcutArgs