简体   繁体   中英

How can I create a Package Management/PowerShellGet/OneGet package from an .exe or .msi?

I can fine a whole bunch of information on how to install packages using Package Management (nee PowerShellGet (nee OneGet)), but I can find nearly zero information on creating those packages.

I did find this which describes how to use the Publish-Module cmdlet to publish a PowerShell module, but I cannot find any information on how to create any other sorts of packages.

Specifically, I would like to create two types: from an .MSI, and from an .EXE. The .EXE I only need installed somewhere on the system, and I need the ability to update the PATH environment variable to allow it to be run by users. For the .MSI, I would ideally like it to be installed (using msiexec), but if that's not possible, I can use other means.

The only remotely-related information I can find is from Chocolatey, which is a system that predates Package Management but that Package Management works with (maybe? sorta? not really clear?). Chocolatey can create packages, but is that really the only way to create packages for Package Management?

Where can I find information on how to accomplish these packaging tasks?

To quote Microsoft :

PackageManagement is essentially a Package Management Aggregator. It creates a unified and consistent PowerShell interface for users and provides a plug-in model at the back end that different installer technologies or package managers can plug-in as providers, using PackageManagement APIs. Each provider further manages one or multiple package sources (repositories) where software packages are stored.

This means there isn't a single way of creating packages, it will depend which Package Management Provider and/or Package Source you are using.

NuGet is widely documented, and so is Chocolatey (which has a plugin available for package management)

If you're looking to install your own private software, as opposed to commercially available software (where you're best off just using one of the existing repositories), you will need to create your own feed/repo. Again this will depend which options you're using. For example, the NuGet documentation on this is readily available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM