$ErrorActionPreference = 'Stop' $toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition $version = $env:ChocolateyPackageVersion $installDir = Join-Path $env:ProgramFiles 'MmdPdf' $installExe = Join-Path $installDir 'MmdPdf.exe' $packageArgs = @{ packageName = $env:ChocolateyPackageName fileFullPath = Join-Path $toolsDir 'MmdPdf.exe' url64bit = "https://github.com/SteveTheKiller/MmdPdf/releases/download/v$version/MmdPdf.exe" checksum64 = 'REPLACE_HASH' checksumType64 = 'sha256' } Get-ChocolateyWebFile @packageArgs # Copy to Program Files New-Item -ItemType Directory -Force -Path $installDir | Out-Null Copy-Item (Join-Path $toolsDir 'MmdPdf.exe') $installExe -Force # Start Menu shortcut (All Users) $startMenuPath = Join-Path $env:ProgramData 'Microsoft\Windows\Start Menu\Programs\MmdPdf.lnk' Install-ChocolateyShortcut -ShortcutFilePath $startMenuPath -TargetPath $installExe