-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PSADT template #16
base: main
Are you sure you want to change the base?
Add PSADT template #16
Conversation
∙ ∙ This change adds a template for generating Chocolatey packages ∙ from a PSADT application. ∙ ∙ PSAppDeployToolkit is a framework for generating an executable with ∙ silent installation parameters via PowerShell.
statements = "-DeploymentType 'Uninstall' -DeployMode 'Silent'" | ||
} | ||
|
||
Start-ChocolateyProcessAsAdmin @packageArgs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest switching to Uninstall-ChocolateyPackage
if possible, as that has support for valid exit codes.
$destination = (Join-Path $toolsDir -ChildPath $env:ChocolateyPackageName) | ||
|
||
|
||
$adtExe = Join-Path $destination -ChildPath "Deploy-Application.exe" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this deploy-application.exe
needed to be excluded from the package reducer?
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. --> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd"> | ||
<metadata> | ||
<id>psadt-silent.template</id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all Chocolatey packages should be silent, this could be simplified to psadt.template
<version>1.0.0</version> | ||
<packageSourceUrl>https://github.com/chocolatey-community/chocolatey-templates/tree/main/src/psadt-silent.template</packageSourceUrl> | ||
<owners>Stephen Valdinger, Chocolatey-Community</owners> | ||
<title>PSADT Template</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<title>PSADT Template</title> | |
<title>PSAppDeployToolkit Template</title> |
|
||
Install-ChocolateyInstallPackage @packageArgs | ||
} catch { | ||
$packageArgs = @{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason this catch block is needed? It seems to be doing pretty much the same thing as the try block.
$zipArchive = Join-Path $toolsDir -ChildPath '[[Zip]]' | ||
$destination = (Join-Path $toolsDir -ChildPath $env:ChocolateyPackageName) | ||
|
||
Get-ChocolateyUnzip -FileFullPath $zipArchive -Destination $destination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the zip archive is embedded, it is probably best to include the license and verification template files.
The PSAppDeployToolkit is a great framework for generating deployable executables with silent arguments.
You can leverage these PSADT applications in Chocolatey packages if you zip them up and distribute them. This template helps a user create a Chocolatey package for PSADT applications.
Related: #5