Skip to content
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

Clarify packaging documentation #1066

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default defineConfig({
'/en-us/chocolatey-gui/setup/installation/chocolateygui': '/en-us/chocolatey-gui/setup/installation/',
'/en-us/chocolatey-gui/setup/installation/chocolatey-gui': '/en-us/chocolatey-gui/setup/installation/',
'/en-us/chocolatey-gui/setup/uninstallation/chocolatey-gui': '/en-us/chocolatey-gui/setup/uninstallation/',
'/docs/chocolatey-install-ps1': '/en-us/chocolatey-install-ps1/',
'/docs/chocolatey-install-ps1': '/en-us/create/package-scripts/',
'/docs/chocolatey-story': '/en-us/chocolatey-story/',
'/docs/chocolatey-vs-ninite': '/en-us/chocolatey-vs-ninite/',
'/docs/community-packages-disclaimer': '/en-us/community-repository/community-packages-disclaimer/',
Expand Down Expand Up @@ -354,4 +354,4 @@ export default defineConfig({
'/en-us/create/functions/test-processadminrights': '/en-us/create/cmdlets/test-processadminrights/',
'/en-us/create/functions/update-sessionenvironment': '/en-us/create/cmdlets/update-sessionenvironment/',
}
});
});
40 changes: 0 additions & 40 deletions src/content/docs/en-us/chocolatey-install-ps1.mdx

This file was deleted.

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions src/content/docs/en-us/create/cmdlets/index.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
order: 35
order: 45
xref: powershell-cmdlet-reference
title: PowerShell Cmdlet Reference
description: PowerShell Cmdlet Helpers Reference
title: Chocolatey PowerShell Cmdlet Reference
description: Chocolatey PowerShell Cmdlet Reference
---
import Xref from '@components/Xref.astro';

# PowerShell Cmdlet Helpers Reference

See also: <Xref title="PowerShell Functions Reference" value="powershell-reference" />
> :choco-info: **NOTE**
>
> As we migrate our PowerShell functions to cmdlets, please see the <Xref title="PowerShell Functions Reference" value="powershell-reference" />.

## Summary

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en-us/create/create-packages-quick-start.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
order: 20
order: 10
xref: create-packages-quick-start
title: Quick Start
description: The quick start guide on creating Chocolatey packages
description: The quick start guide to creating Chocolatey packages.
---
import Callout from '@choco/components/Callout.astro';
import Iframe from '@choco/components/Iframe.astro';
Expand Down
504 changes: 72 additions & 432 deletions src/content/docs/en-us/create/create-packages.mdx

Large diffs are not rendered by default.

370 changes: 185 additions & 185 deletions src/content/docs/en-us/create/functions/index.mdx

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/content/docs/en-us/create/package-dependencies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ Now that you see how dependencies are defined, their syntax, and how they work,

It is also helpful for very complex packages where a package may take a dependency, which in turn has another dependency. Chocolatey will walk this dependency chain all the way to the beginning, and work backwards until all dependencies are met, and then proceed to install your requested package.

See [`ferventcoder.chocolatey.utilities nuspec`](https://github.com/ferventcoder/chocolatey-packages/blob/master/manual/ferventcoder.chocolatey.utilities/ferventcoder.chocolatey.utilities.nuspec) as an example of what you can do.

## Wrapping up

As you can see dependencies in Chocolatey packages are relatively easy to understand, define, and utilize in your Chocolatey packaging! We encourage you to take advantage of this enhanced functionality in your environments.

Still have questions? Join our [Discord](Community Chat)! If you're a Chocolatey For Business customer, run `choco support` to see how to get in touch with our support team, who are at the ready to assist you with Package Dependencies!
Still have questions? Join our [Discord](Community Chat)! If you're a Chocolatey For Business customer, run `choco support` to see how to get in touch with our support team, who are at the ready to assist you with Package Dependencies!
26 changes: 26 additions & 0 deletions src/content/docs/en-us/create/package-faq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
order: 35
xref: package-faq
title: Chocolatey Package FAQ
description: Frequently Asked Questions about Chocolatey packages and packaging.
---
import Callout from '@choco/components/Callout.astro';
import Iframe from '@choco/components/Iframe.astro';
import Xref from '@components/Xref.astro';

## Where is the Chocolatey Package Path?

The Chocolatey package path is located at `$env:ChocolateyInstall\lib\<PACKAGENAME>` where:

- `$env:ChocolateyInstall` is the value of the `ChocolateyInstall` PowerShell environment variable (by default this is `C:\ProgramData\chocolatey`).
- `<PACKAGENAME>` is the ID of the package you are installing.

## How Do I Restrict What Versions of Windows a Package Will Install On

If the package is installing software that is only supported on a specific version of Windows, you need to **throw a terminating error** which Chocolatey CLI will detect and indicate a package installation failure. In PowerShell, you can create throw an exception using [`throw`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_throw?view=powershell-5.1).

There are a very small number of packages where this rule will not apply: packages, such as Windows KB's, that are used as dependencies and need to be installed even if they do not install anything. If the package failed, and it was a dependency of another package, it may cause issues for the parent package.

## How Do I Stop Packages From Being Installed on Some Versions of Windows

See [How Do I Restrict What Versions of Windows a Package Will Install On](#how-do-i-restrict-what-versions-of-windows-a-package-will-install-on).
Loading
Loading