diff --git a/build/05-release-Chocolatey.ps1 b/build/05-release-Chocolatey.ps1 index ecacecbf..74680c49 100644 --- a/build/05-release-Chocolatey.ps1 +++ b/build/05-release-Chocolatey.ps1 @@ -24,18 +24,14 @@ if ($env:version) { "- Cleaning Choco template folder" git clean .\Build\Chocolatey\gsudo -xf -"- Adding Artifacts" -cp artifacts\x?? .\Build\Chocolatey\gsudo\tools -Recurse -Force -Exclude *.pdb -cp artifacts\arm64 .\Build\Chocolatey\gsudo\tools -Recurse -Force -Exclude *.pdb - Get-ChildItem .\build\Chocolatey\gsudo\tools\ -Recurse -Filter *.exe | % { ni "$($_.FullName).ignore" } > $null # Generate gsudo.nuspec (Get-Content Build\Chocolatey\gsudo.nuspec.template) -replace '#VERSION#', "$version" | Out-File -encoding UTF8 .\Build\Chocolatey\gsudo\gsudo.nuspec # Generate chocolateyinstall.ps1 -(Get-Content .\build\Chocolatey\gsudo\tools\chocolateyinstall.ps1.template) - -replace '#VERSION#', "$version" +(Get-Content .\build\Chocolatey\chocolateyinstall.ps1.template) ` + -replace '#VERSION#', "$version" ` -replace '#SHA#', (Get-FileHash .\artifacts\gsudoSetup.msi).Hash | Out-File -encoding UTF8 .\build\Chocolatey\gsudo\tools\chocolateyinstall.ps1 diff --git a/build/Chocolatey/gsudo/tools/chocolateyinstall.ps1.template b/build/Chocolatey/chocolateyinstall.ps1.template similarity index 90% rename from build/Chocolatey/gsudo/tools/chocolateyinstall.ps1.template rename to build/Chocolatey/chocolateyinstall.ps1.template index 2d1d1a40..50045be6 100644 --- a/build/Chocolatey/gsudo/tools/chocolateyinstall.ps1.template +++ b/build/Chocolatey/chocolateyinstall.ps1.template @@ -84,7 +84,7 @@ $packageArgs = @{ checksum64 = '#SHA#' checksumType64= 'sha256' - silentArgs = "" # ALLUSERS=1 DISABLEDESKTOPSHORTCUT=1 ADDDESKTOPICON=0 ADDSTARTMENU=0 + silentArgs = "/qn /norestart" # ALLUSERS=1 DISABLEDESKTOPSHORTCUT=1 ADDDESKTOPICON=0 ADDSTARTMENU=0 validExitCodes= @(0, 3010, 1641) } @@ -101,8 +101,10 @@ Install-ChocolateyPackage @packageArgs Update-SessionEnvironment if (Get-Module gsudoModule) { - if ((get-Module gsudoModule).Path) - " Import-Module `'$((Get-Command gsudoModule.psd1).Source)`'" + if ((Split-Path (Get-Module gsudoModule).Path -Parent) -ne (Split-Path (Get-Command gsudoModule.psd1). Source -Parent)) { + "IMPORTANT! Please update your `$PROFILE: Use the following gsudoModule path." + " Import-Module `'$((Get-Command gsudoModule.psd1).Source)`'" + } } else { & { "PowerShell users: To use enhanced gsudo and Invoke-Gsudo cmdlet, add the following line to your `$PROFILE" @@ -110,6 +112,6 @@ if (Get-Module gsudoModule) { "Or run: " " Get-Command gsudoModule.psd1 | % { Write-Output `"``nImport-Module ```"`$(`$_.Source)```"`" | Add-Content `$PROFILE }" } -Write-Output "`ngsudo successfully installed. Please restart your consoles to use gsudo.`n" - + +Write-Output "`nPlease restart your consoles to use gsudo.`n" } diff --git a/build/Chocolatey/gsudo/Bin/gsudo.exe.ignore b/build/Chocolatey/gsudo/Bin/.donotdelete similarity index 100% rename from build/Chocolatey/gsudo/Bin/gsudo.exe.ignore rename to build/Chocolatey/gsudo/Bin/.donotdelete diff --git a/build/Chocolatey/gsudo/Bin/sudo.exe.ignore b/build/Chocolatey/gsudo/Bin/sudo.exe.ignore deleted file mode 100644 index e69de29b..00000000