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

Install-ChocolateyPackage / Install-ChocolateyInstallPackage - In addition to SoftwareDisplayName/Version, add a flag for uninstall/reinstall #1714

Open
bcurran3 opened this issue Jan 15, 2019 · 3 comments

Comments

@bcurran3
Copy link

bcurran3 commented Jan 15, 2019

Sometimes during packaging it would be nice to know if the package is being installed or upgraded.

This comes in to play when some programs need to be uninstalled before a new version can be installed (drobo-dashboard off the top of my head).

Sure, we packagers can check "things" to figure it out, but a variable check would be a lot easier.

SUGGESTION:
$ENV:ChocolateyInstall = $True or $False as it can be assumed that if $ENV:ChocolateyInstall is false than an upgrade status would be $True. (Unless there are other scenarios I can't think of right now.)

or

$ENV:ChocoInstall = $True or $False as it can be assumed that if $ENV:ChocoInstall is false than an upgrade status would be $True. (Unless there are other scenarios I can't think of right now.)

or maybe since the upgrade status is more important, $ENV:ChocolatyUpgrade or $ENV:ChocoUpgrade would be more relevant and if $False it could be assumed an install was happening versus an upgrade.

@bcurran3 bcurran3 changed the title FEATURE REQUEST: Add Install or Update environmental variable FEATURE REQUEST: Add Install and/or/versus Update status environmental variable Jan 15, 2019
@ferventcoder
Copy link
Member

@bcurran3 why we don't provide anything -

  • Installing a package for the first time could be installing or upgrading existing software.

So all we can do is provide a notice on whether the Chocolatey package is installed, not whether if it is an installer package that the underlying software is installed.

So sometimes an install is actually an upgrade, thus why the contract is that the packaging should handle those checks. There are plans to make some of that process a bit better by providing some options you can give to the functions. I think if we rewrite this a bit that this could be a great use for that. Let me change up the heading.

@ferventcoder ferventcoder changed the title FEATURE REQUEST: Add Install and/or/versus Update status environmental variable Install-ChocolateyInstallPackage - in addition to softwareDisplayName/Version, add a flag for uninstall/reinstall Jan 18, 2019
@ferventcoder ferventcoder modified the milestones: 0.10.13, 0.10.x Jan 18, 2019
@ferventcoder
Copy link
Member

I can't find if we have a logged issue for the softwaredisplayname / software version here or not - those are a couple of things which will determine if it is even necessary to procure a newer version, so they would also be available in Install-ChocolateyPackage.

@ferventcoder ferventcoder changed the title Install-ChocolateyInstallPackage - in addition to softwareDisplayName/Version, add a flag for uninstall/reinstall Install-ChocolateyPackage / Install-ChocolateyInstallPackage - in addition to softwareDisplayName/Version, add a flag for uninstall/reinstall Jan 18, 2019
@ferventcoder ferventcoder changed the title Install-ChocolateyPackage / Install-ChocolateyInstallPackage - in addition to softwareDisplayName/Version, add a flag for uninstall/reinstall Install-ChocolateyPackage / Install-ChocolateyInstallPackage - In addition to SoftwareDisplayName/Version, add a flag for uninstall/reinstall Jan 18, 2019
@ferventcoder
Copy link
Member

There is some design and future planning work to be completed here, so I'm holding this to core team for implementation.

@vexx32 vexx32 modified the milestones: 0.11.x, Future, Future_ Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants