-
Notifications
You must be signed in to change notification settings - Fork 907
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
Provide ability to export all currently installed packages to a packages.config file #357
Comments
Upon further consideration, I'd probably remove the flags for formatting. Exporting as a list would be the same as running |
This is the same as chocolatey-archive/chocolatey#67, which needed migrated over. So thank you. |
Great! In terms of design, it sounds like there are multiple goals:
Is this correct? |
Sounds about right, but I don't think I would keep around a packages config file all the time to manage state. I would rather capture what args were used to install a package in the package information. This would be especially helpful for building the packages.config, but also for other purposes like knowing what to pass to build upgrade commands. |
I know we talked about this a lot over @ chocogui. First class support would be great, def including things like source and args information if necessary. |
@RichiCoder1 yeah, I agree it'd be awesome to have this ability at the root. So, to clarify since I'm newish and dropping in here -- 😄 -- we want to:
If we agree with the breakdown, I'm assuming we should create separate issues / tasks to support these individual items and reference them as appropriate? |
That's what we tend to do. Break things down to manageable units and somehow mark things as blocking. |
Alright, I'll go ahead and organize them as I've outlined above. |
As mentioned by @RichiCoder1, the basic export functionality is already included in ChocolateyGUI, as per this screenshot: But it would be good to fall back on the functionality which could be included in Chocolatey, rather than re-invent the wheel. |
Any progress/timeline on this feature? |
@Cyber1000 note the milestone to the right and the labels. That should give you an idea where this is at. HTH |
A couple other options: Personally, I'm not really interested in any arguments since I have never used any arguments when installing chocolatey packages. |
I'd enjoy a choco config export that you could roll into a scheduled task which saves the file to OneDrive/GDrive/wherever. Please and thank you. Though kinda solved a bit lumpy - https://gist.github.com/alimbada/449ddf65b4ef9752eff3 |
I had a computer die on me after 6 years, I too wish I had an export function so I can save a copy of whats installed onto my Dropbox! |
You can also use the ChocolateyGUI package to create an export.
…On Jul 24, 2017 7:16 PM, "Cronus89" ***@***.***> wrote:
I had a computer die on me after 6 years, I too wish I had an export
function so I can save a copy of whats installed onto my Dropbox!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#357 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAdxXtRSAn16IO_zt9PH2nnuTOMjL_n5ks5sRTPVgaJpZM4Fdm5L>
.
|
Yes but I am looking for something automated. i could not find any command line arguments for the GUI that allow an auto export |
I'm thinking it wouldn't be to hard to create PS script that would get the directory names (thus packages) from \programdata\chocolatey\lib, save it to a file, parse the package names to one line, add a cup in front of it (or cup in front of each line would probably be easier), then check for the existence of DropBox, OneDrive, Gdrive, and save the file in one or all of them. The script could then just be distributed as a package; backup-choco-package-list or some such. I might take this on. It would be a small challenge for me but I could learn from forcing my way through it, as I'm bad at parsing arrays. :) I'm willing to take it on in package form as a kludge until it's function is build into choco. I'm guessing a sequel, restore-choco-package-list would then be in order. |
@itopiacloud Thanks for the info. I checked it out and it didn't really do what I wanted, but it did give me some clues how to do what I wanted. So until there is an official way to do this with Chocolatey... I did it my way! :) Done! Off personal TDL: |
So that the method to get_all_installed_packages can be consumed from elsewhere in the codebase. This meant extending the interface for INugetService to include this method as well, otherwise, a concrete reference to an instance of NuGetService would be required, which is not available.
This will allow the creation of a packages.config file of all the currently installed packages on the machine. Usage of this command will be: choco export -o c:/temp/packages.config --include-version-numbers This command is particularly useful when re-building a machine. i.e. First export all packages currently installed on machine, and then replay this packages.config via choco install packages.config on new machine.
So that the method to get_all_installed_packages can be consumed from elsewhere in the codebase. This meant extending the interface for INugetService to include this method as well, otherwise, a concrete reference to an instance of NuGetService would be required, which is not available.
This will allow the creation of a packages.config file of all the currently installed packages on the machine. Usage of this command will be: choco export -o c:/temp/packages.config --include-version-numbers This command is particularly useful when re-building a machine. i.e. First export all packages currently installed on machine, and then replay this packages.config via choco install packages.config on new machine.
So that the method to get_all_installed_packages can be consumed from elsewhere in the codebase. This meant extending the interface for INugetService to include this method as well, otherwise, a concrete reference to an instance of NuGetService would be required, which is not available.
This will allow the creation of a packages.config file of all the currently installed packages on the machine. Usage of this command will be: choco export -o c:/temp/packages.config --include-version-numbers This command is particularly useful when re-building a machine. i.e. First export all packages currently installed on machine, and then replay this packages.config via choco install packages.config on new machine.
So that the method to get_all_installed_packages can be consumed from elsewhere in the codebase. This meant extending the interface for INugetService to include this method as well, otherwise, a concrete reference to an instance of NuGetService would be required, which is not available.
This will allow the creation of a packages.config file of all the currently installed packages on the machine. Usage of this command will be: choco export -o c:/temp/packages.config --include-version-numbers This command is particularly useful when re-building a machine. i.e. First export all packages currently installed on machine, and then replay this packages.config via choco install packages.config on new machine.
So that the method to get_all_installed_packages can be consumed from elsewhere in the codebase. This meant extending the interface for INugetService to include this method as well, otherwise, a concrete reference to an instance of NuGetService would be required, which is not available.
This will allow the creation of a packages.config file of all the currently installed packages on the machine. Usage of this command will be: choco export -o c:/temp/packages.config --include-version-numbers This command is particularly useful when re-building a machine. i.e. First export all packages currently installed on machine, and then replay this packages.config via choco install packages.config on new machine.
To cover the new functionality of the export command. This includes verifying the option sets, what methods are called under certain circumstances, etc.
So that the method to get_all_installed_packages can be consumed from elsewhere in the codebase. This meant extending the interface for INugetService to include this method as well, otherwise, a concrete reference to an instance of NuGetService would be required, which is not available.
This will allow the creation of a packages.config file of all the currently installed packages on the machine. Usage of this command will be: choco export -o c:/temp/packages.config --include-version-numbers This command is particularly useful when re-building a machine. i.e. First export all packages currently installed on machine, and then replay this packages.config via choco install packages.config on new machine.
To cover the new functionality of the export command. This includes verifying the option sets, what methods are called under certain circumstances, etc.
When creating an output export file from a path like "packages.config" we need to ensure to use the full file path to the file, otherwise it won't be able to backup the file correctly, if it already exists on the file system. Without this, we were seeing errors when trying to ensure that the directory that the file was contained in was created, since this was an empty string.
There are no subcommands for the export command, so we just need to include the available options that are supported.
* stable: (44 commits) (#2220) Add convert command to allowed list (#2049) Add --version to top level tab expansion (#944) Add tab expansion for help command (#357) Add tab expansion for export command (#357) Ensure to use full file path (maint) fix typo (maint) formatting (doc) pin: show reasons option (maint) log message on nuget conflict (#2270) Update to NuGet.exe 5.9.1.11 (#2049) Add version option to help text (#2112) Add msp support to Install helper (maint) Change formatting (maint) Switch to using a Regex match (#2244) Add badge for latest docker semver version (#2244) Add status badge for GitHub Action (#2261) Minor tweak to remove extra space (#2261) Updates License Headers Copyright to 2021 (#2263) Pack on Mono pass absolute path to PackageBuilder (#2244) Add Docker build into main workflow ...
* release/0.12.0: (102 commits) (maint) Add generation of template command (#2522) Update documentation (maint) Remove unnecessary whitespace (#2522) Remove deprecated ScriptsCheckLastExitCode (maint) Fix spelling mistake (version) 0.12.0-beta (#2518) Add tab completion for template command (#2481) Warn about unuspported packages on non-Windows (#357) Add information about when command added (#449) Add information about when command added (#499) Add specs for template service list noop (#499) Add specs for template command (#449) Add template command (#449) Template service rename noop to generate_noop (#2434) Correct casing of filename in changed files tests (#2434) Enable more scenarios, skip only shim and powershell facts (#2450) Enable configTransform tests on non-Windows (#2450) Enable functions on non-Windows systems (maint) Corrected casing of PowerShell (#2510) Exclude uninstalling with locked file on non-windows ...
Leaving this here as a suggested enhancement because I couldn't find it anywhere. If there's support for it, I'll look into whether I could contribute the change myself.
Use case / story
Sometimes, my whole system will become bricked (such as it did yesterday -- ouch). However, this is a lot less painful because I export my package list and restore using that.
Have I mentioned that Chocolatey is amazing? :)
However, there is still some pain here -- I have to manually concatenate the package names, remove the explicit version numbers, etc.
Proposed change
choco export
orcexp
Example usage
In a scheduled task, I can see running something along the lines of the following:
choco export -conf C:\MyBackupLocation\packages_yyyy-mm-dd.conf
Then, the next time my system gets bricked, it should be as easy as:
choco install -y C:\MyBackupLocation\packages_yyyy-mm-dd.conf
Thoughts?
The text was updated successfully, but these errors were encountered: