Skip to content

Commit

Permalink
Install - Copy msi to choco package
Browse files Browse the repository at this point in the history
  • Loading branch information
Liryna committed Feb 4, 2024
1 parent fbbcc3d commit 415ac36
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -57,3 +56,4 @@ ReleasePS
/setup.rpt
*.bak
*.log
*.msi
6 changes: 4 additions & 2 deletions chocolatey/package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions chocolatey/tools/chocolateyinstall.ps1.template
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
$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
unzipLocation = $toolsDir
fileType = 'MSI'
url = '[[Url]]'
url64bit = '[[Url64]]'
#file = $fileLocation

softwareName = 'Dokan Library*'

Expand All @@ -24,3 +24,4 @@ $packageArgs = @{
}

Install-ChocolateyPackage @packageArgs
Remove-Item $toolsDir\*.msi -Force -EA SilentlyContinue | Out-Null

0 comments on commit 415ac36

Please sign in to comment.