From 415ac366eaa7a257ceb217e79dab9f37fadc7d33 Mon Sep 17 00:00:00 2001 From: Liryna Date: Sun, 4 Feb 2024 09:32:18 -0500 Subject: [PATCH] Install - Copy msi to choco package --- .gitignore | 2 +- chocolatey/package.ps1 | 6 ++++-- chocolatey/tools/chocolateyinstall.ps1.template | 9 +++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index d618f5f7..40b4a785 100644 --- a/.gitignore +++ b/.gitignore @@ -39,7 +39,6 @@ ReleasePS /dokan_fuse/libdokanfuse1.dll /dokan.VC.db /documentations/doc -/dokan_wix/*.msi /dokan_wix/disk1 /dokan_wix/setup.inf /dokan_wix/setup.rpt @@ -57,3 +56,4 @@ ReleasePS /setup.rpt *.bak *.log +*.msi \ No newline at end of file diff --git a/chocolatey/package.ps1 b/chocolatey/package.ps1 index 7e7ce128..1b4bcbb6 100644 --- a/chocolatey/package.ps1 +++ b/chocolatey/package.ps1 @@ -7,6 +7,8 @@ Remove-Item .\chocolatey\build -Recurse -Force -ErrorAction SilentlyContinue New-Item .\chocolatey\build -Force -ItemType Directory Copy-Item .\chocolatey\dokany.nuspec.template .\chocolatey\build\dokany.nuspec Copy-Item .\chocolatey\tools .\chocolatey\build\ -Recurse +Copy-Item .\dokan_wix\Dokan_x64.msi .\chocolatey\build\tools\Dokan_x64.msi +Copy-Item .\dokan_wix\Dokan_x86.msi .\chocolatey\build\tools\Dokan_x86.msi Rename-Item .\chocolatey\build\tools\chocolateyinstall.ps1.template chocolateyinstall.ps1 (Get-Content -Encoding UTF8 .\chocolatey\build\dokany.nuspec).Replace('[[PackageVersion]]', $version) | Set-Content -Encoding UTF8 .\chocolatey\build\dokany.nuspec @@ -20,8 +22,8 @@ function Hash { return $hash.Hash } -$hash64 = Hash .\dokan_wix\Dokan_x64.msi -$hash32 = Hash .\dokan_wix\Dokan_x86.msi +$hash64 = Hash .\chocolatey\build\tools\Dokan_x64.msi +$hash32 = Hash .\chocolatey\build\tools\Dokan_x86.msi $install = (Get-Content .\chocolatey\build\tools\chocolateyinstall.ps1) $install = $install.Replace('[[Url]]', $url32).Replace('[[Checksum]]', $hash32) diff --git a/chocolatey/tools/chocolateyinstall.ps1.template b/chocolatey/tools/chocolateyinstall.ps1.template index 215e1491..5a30bcaa 100644 --- a/chocolatey/tools/chocolateyinstall.ps1.template +++ b/chocolatey/tools/chocolateyinstall.ps1.template @@ -1,8 +1,9 @@ $ErrorActionPreference = 'Stop'; -$packageName= 'dokany2' -$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -#$fileLocation = Join-Path $toolsDir 'NAME_OF_EMBEDDED_INSTALLER_FILE' +$packageName = 'dokany2' +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$url = "$toolsDir\Dokan_x86.msi" +$url64 = "$toolsDir\Dokan_x64.msi" $packageArgs = @{ packageName = $packageName @@ -10,7 +11,6 @@ $packageArgs = @{ fileType = 'MSI' url = '[[Url]]' url64bit = '[[Url64]]' - #file = $fileLocation softwareName = 'Dokan Library*' @@ -24,3 +24,4 @@ $packageArgs = @{ } Install-ChocolateyPackage @packageArgs +Remove-Item $toolsDir\*.msi -Force -EA SilentlyContinue | Out-Null