From 359278afec2f41362deea2f48c62dab28800cfff Mon Sep 17 00:00:00 2001 From: Oleksii Holub Date: Tue, 9 Apr 2019 18:15:17 +0300 Subject: [PATCH] Optimize chocolatey package --- Deploy/Choco/tools/chocolateyinstall.ps1 | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Deploy/Choco/tools/chocolateyinstall.ps1 b/Deploy/Choco/tools/chocolateyinstall.ps1 index b3f9557..79bba1d 100644 --- a/Deploy/Choco/tools/chocolateyinstall.ps1 +++ b/Deploy/Choco/tools/chocolateyinstall.ps1 @@ -1,19 +1,24 @@ -$ErrorActionPreference = 'Stop'; +$ErrorActionPreference = 'Stop' +$packageName = $env:ChocolateyPackageName +$installDirPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -# --- GUI --- +# Install package (GUI) $packageArgs = @{ - packageName = $env:ChocolateyPackageName - unzipLocation = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" - url = 'https://github.com/Tyrrrz/DiscordChatExporter/releases/download/2.11/DiscordChatExporter.zip' + packageName = $packageName + unzipLocation = $installDirPath + url = 'https://github.com/Tyrrrz/DiscordChatExporter/releases/download/2.11/DiscordChatExporter.zip' } Install-ChocolateyZipPackage @packageArgs -# --- CLI --- +# Mark the executable as GUI +New-Item (Join-Path $installDirPath "DiscordChatExporter.exe.gui") -ItemType File -Force + +# Install package (CLI) $packageArgs = @{ - packageName = $env:ChocolateyPackageName - unzipLocation = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" - url = 'https://github.com/Tyrrrz/DiscordChatExporter/releases/download/2.11/DiscordChatExporter.CLI.zip' + packageName = $packageName + unzipLocation = $installDirPath + url = 'https://github.com/Tyrrrz/DiscordChatExporter/releases/download/2.11/DiscordChatExporter.CLI.zip' } Install-ChocolateyZipPackage @packageArgs \ No newline at end of file