浏览代码

Merge pull request #550 from TheCakeIsNaOH/develop

Chocolatey package include binaries in package

Closes #548
Antony Male 5 年之前
父节点
当前提交
babbc8165c
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 1 0
      Rakefile
  2. 6 3
      chocolatey/tools/chocolateyinstall.ps1

+ 1 - 0
Rakefile

@@ -257,6 +257,7 @@ task :package => [:clean, *ARCH_CONFIG.map{ |x| :"package:#{x.arch}" }, :"create
 desc 'Build chocolatey package'
 task :chocolatey do
   chocolatey_dir = File.dirname(CHOCOLATEY_NUSPEC)
+  cp Dir[File.join(DEPLOY_DIR, 'SyncTrayzorSetup-*.exe')], File.join(chocolatey_dir, 'tools')
   Dir.chdir(chocolatey_dir) do
     sh "choco pack"
   end

+ 6 - 3
chocolatey/tools/chocolateyinstall.ps1

@@ -1,10 +1,13 @@
 $ErrorActionPreference = 'Stop'; # stop on all errors
+$toolsDir              = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
 
 $packageName= 'SyncTrayzor'
-$url        = "https://github.com/canton7/SyncTrayzor/releases/download/v${env:chocolateyPackageVersion}/SyncTrayzorSetup-x86.exe"
-$url64      = "https://github.com/canton7/SyncTrayzor/releases/download/v${env:chocolateyPackageVersion}/SyncTrayzorSetup-x64.exe"
+$file       = (Join-Path $toolsDir 'SyncTrayzorSetup-x86.exe')
+$file64     = (Join-Path $toolsDir 'SyncTrayzorSetup-x64.exe')
 $silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
 $fileType   = 'exe'
 $validExitCodes = @(0)
 
-Install-ChocolateyPackage $packageName $fileType $silentArgs $url $url64 -validExitCodes $validExitCodes
+Install-ChocolateyInstallPackage $packageName $fileType $silentArgs $file $file64 -validExitCodes $validExitCodes
+
+Remove-Item -Force -ea 0 $file, $file64