From dbaa52a12ebca960f34335ba49c8681dd4b702d4 Mon Sep 17 00:00:00 2001 From: Eric Fontana Date: Mon, 13 Apr 2015 07:31:06 -0400 Subject: [PATCH 1/5] Embed the MSI into chocolatey package --- chocolateyInstall.ps1.template | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/chocolateyInstall.ps1.template b/chocolateyInstall.ps1.template index 63002c1..f2c908b 100644 --- a/chocolateyInstall.ps1.template +++ b/chocolateyInstall.ps1.template @@ -1,8 +1,14 @@ $packageName = 'TimberWinR-${version}' -$installerType = 'msi' -$url = 'http://www.ericfontana.com/TimberWinR/TimberWinR-${version}.0.msi' +$fileType = 'msi' $silentArgs = '/quiet' -$validExitCodes = @(0) -Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes +$scriptPath = $(Split-Path $MyInvocation.MyCommand.Path) +$fileFullPath = Join-Path $scriptPath 'TimberWinR-${version}' +try { + Install-ChocolateyInstallPackage $packageName $fileType $silentArgs $fileFullPath +} catch { + Write-ChocolateyFailure $packageName $($_.Exception.Message) + throw +} + From 3d0bfc248d46a7694d546e95f5fe628168b1a8d1 Mon Sep 17 00:00:00 2001 From: Eric Fontana Date: Mon, 13 Apr 2015 07:42:58 -0400 Subject: [PATCH 2/5] Stage the MSI for chocolatey --- TimberWix/TimberWinR.Wix.wixproj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TimberWix/TimberWinR.Wix.wixproj b/TimberWix/TimberWinR.Wix.wixproj index 3c7c4d3..3db7cc8 100644 --- a/TimberWix/TimberWinR.Wix.wixproj +++ b/TimberWix/TimberWinR.Wix.wixproj @@ -98,10 +98,12 @@ - $(SolutionDir)\TimberWinR.ExtractID\$(OutDir)\TimberWinR.ExtractID.exe $(TargetDir) $(SolutionDir)chocolateyUninstall.ps1.guid $(SolutionDir)chocolateyUninstall.ps1.template + mkdir $(SolutionDir)tools +cmd.exe /c copy $(SolutionDir)chocolateyUninstall.ps1.template.orig $(SolutionDir)chocolateyUninstall.ps1.template - cmd.exe /c copy $(SolutionDir)chocolateyUninstall.ps1.template.orig $(SolutionDir)chocolateyUninstall.ps1.template + $(SolutionDir)\TimberWinR.ExtractID\$(OutDir)\TimberWinR.ExtractID.exe $(TargetDir) $(SolutionDir)chocolateyUninstall.ps1.guid $(SolutionDir)chocolateyUninstall.ps1.template +cmd.exe /c copy "$(TargetDir)%2a.msi" "$(SolutionDir)tools"