Downloads:
345,307,852
Downloads of v 0.10.6-beta-20170503:
8,273
Last Update:
03 May 2017
Package Maintainer(s):
Software Author(s):
- Chocolatey Software
- Inc
Tags:
nuget apt-get machine repository chocolatey- Software Specific:
- Software Site
- Software License
- Package Specific:
- Possible Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Chocolatey
This is a prerelease version of Chocolatey.
- 1
- 2
- 3
0.10.6-beta-20170503 | Updated: 03 May 2017
- Software Specific:
- Software Site
- Software License
- Package Specific:
- Possible Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Downloads:
345,307,852
Downloads of v 0.10.6-beta-20170503:
8,273
Maintainer(s):
Software Author(s):
- Chocolatey Software
- Inc
Chocolatey 0.10.6-beta-20170503
This is a prerelease version of Chocolatey.
- 1
- 2
- 3
Some Checks Have Failed or Are Not Yet Complete
Not All Tests Have Passed
Please visit our documentation to learn how to install/uninstall Chocolatey.
To upgrade Chocolatey, run the following command from the command line or from PowerShell:
This package was approved as a trusted package on 03 May 2017.
Chocolatey is a package manager for Windows (like apt-get but for Windows). It was designed to be a decentralized framework for quickly installing applications and tools that you need. It is built on the NuGet infrastructure currently using PowerShell as its focus for delivering packages from the distros to your door, err computer.
Chocolatey is brought to you by the work and inspiration of the community, the work and thankless nights of the Chocolatey Team, with Rob heading up the direction.
You can host your own sources and add them to Chocolatey, you can extend Chocolatey's capabilities, and folks, it's only going to get better.
Commands
There are quite a few commands you can call - you should check out the command reference. Here are the most common:
- Help - choco -? or choco command -?
- Search - choco search something
- List - choco list -lo
- Config - choco config list
- Install - choco install baretail
- Pin - choco pin windirstat
- Outdated - choco outdated
- Upgrade - choco upgrade baretail
- Uninstall - choco uninstall baretail
Alternative installation sources:
- Install ruby gem - choco install compass -source ruby
- Install python egg - choco install sphynx -source python
- Install windows feature - choco install IIS -source windowsfeatures
- Install webpi feature - choco install IIS7.5Express -source webpi
More
For more advanced commands and switches, use choco -?
or choco command -h
. You can also look at the command reference, including how you can force a package to install the x86 version of a package.
Create Packages?
We have some great guidance on how to do that. Where? I'll give you a hint, it rhymes with socks! Docs!
In that mess there is a link to the PowerShell Chocolatey module reference.
md5: 311A1C5858D4B3AFF949D4618C164AFE | sha1: 1F09C342EB9F60899EB7A731490DE2C67E461985 | sha256: 44D5164C8EFF887921EE9F8ED1C9731A1696CA5E9CA75E9862C294BE5546E450 | sha512: 4FCAF465EF3E214C5B9A0D2B707DC01A4A8EB50721795EF5EF3165A5C86C132D5FCAA21E76C2909781DE9BB2444044B47BAE8C6F41F2609B19B278D890037DF2
<!-- TOC -->
- [Committers & Contributors](#committers--contributors)
- [Committers](#committers)
- [Chocolatey Community Team](#chocolatey-community-team)
- [Contributors](#contributors)
- [Other Contributors](#other-contributors)
- [Third Party Licenses - Development](#third-party-licenses---development)
- [Third Party Licenses - Runtime](#third-party-licenses---runtime)
- [7-Zip](#7-zip)
- [AlphaFS](#alphafs)
- [Checksum](#checksum)
- [log4net](#log4net)
- [Microsoft.Web.Xdt](#microsoftwebxdt)
- [NuGet.Core (modified)](#nugetcore-modified)
- [Rhino.Licensing (modified)](#rhinolicensing-modified)
- [Rx (Reactive Extensions)](#rx-reactive-extensions)
- [Shim Generator (shimgen)](#shim-generator-shimgen)
- [SimpleInjector](#simpleinjector)
<!-- /TOC -->
## Committers & Contributors
Chocolatey has been the the thoughts, ideas, and work of a large community. While [Rob](https://github.com/ferventcoder) heads up direction and plays a primary role in development, there are several people that have really been a part of making Chocolatey what it is today.
### Committers
These are the committers to Chocolatey/Choco repositories:
* [Core Development Team](https://github.com/orgs/chocolatey/teams/developers)
* [Rob Reynolds](https://github.com/ferventcoder) - Creator of Chocolatey, committer, vision, direction, community feed moderator
* [Gary Ewan Park](https://github.com/gep13) - Committer, Chocolatey GUI, community feed moderator
* [Matt Wrock](https://github.com/mwrock) - Committer, Creator of BoxStarter, community feed moderator
* [Rich Siegel](https://github.com/rismoney) - Committer, Creator of Puppet provider
* [Richard Simpson](https://github.com/RichiCoder1) - created and maintains the new Chocolatey GUI
### Chocolatey Community Team
The Chocolatey Community Team includes the committers and adds these fine folks:
* [Community Package Repository Moderation Team](https://github.com/orgs/chocolatey/teams/community-moderators)
* [Chocolatey Core Community Maintainers Team](https://github.com/orgs/chocolatey/teams/community-maintainers)
### Contributors
* [choco.exe](https://github.com/chocolatey/choco/graphs/contributors)
* [Original Chocolatey - POSH choco](https://github.com/chocolatey/chocolatey/graphs/contributors)
* [Community Feed / Chocolatey.org](https://github.com/chocolatey/chocolatey.org/graphs/contributors)
### Other Contributors
**NEEDS UPDATED**
* Nekresh (https://github.com/nekresh) - Contributing code and ideas on direction
* Chris Ortman (https://github.com/chrisortman) - package contributions and thoughts on where to take it
* Svein Arne Ackenhausen (https://github.com/acken) - suggestions and thoughts on features and packages
* Marcel Hoyer - suggestions on making this stuff work without administrative access to a machine
* Jason Jarrett (https://github.com/staxmanade) - contributing code and ideas
## Third Party Licenses - Development
Choco is built, tested and analyzed with the following fantastic frameworks (in no particular order):
* ILMerge
* UppercuT (NAnt)
* PublishedApplications
* NuGet.exe
Choco is tested and analyzed with the following rockstar frameworks (in no particular order):
* bdddoc
* NUnit
* Moq
* TinySpec
* Should
* OpenCover
* ReportGenerator
We would like to credit other super sweet tools/frameworks that aid in the development of choco:
* ReSharper
* NuGet Framework
## Third Party Licenses - Runtime
Chocolatey open source uses a number of 3rd party components. Their details are below.
<!-- TOC -->
- [7-Zip](#7-zip)
- [AlphaFS](#alphafs)
- [Checksum](#checksum)
- [log4net](#log4net)
- [Microsoft.Web.Xdt](#microsoftwebxdt)
- [NuGet.Core (modified)](#nugetcore-modified)
- [Rhino.Licensing (modified)](#rhinolicensing-modified)
- [Rx (Reactive Extensions)](#rx-reactive-extensions)
- [Shim Generator (shimgen)](#shim-generator-shimgen)
- [SimpleInjector](#simpleinjector)
<!-- /TOC -->
### 7-Zip
Chocolatey uses [7-Zip](http://www.7-zip.org/) for uncompressing archives. [License terms](http://www.7-zip.org/license.txt):
~~~
7-Zip
License for use and distribution
--------------------------------
7-Zip Copyright (C) 1999-2016 Igor Pavlov.
Licenses for files are:
1) 7z.dll: GNU LGPL + unRAR restriction
2) All other files: GNU LGPL
The GNU LGPL + unRAR restriction means that you must follow both
GNU LGPL rules and unRAR restriction rules.
Note:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.
GNU LGPL information
--------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/
unRAR restriction
-----------------
The decompression engine for RAR archives was developed using source
code of unRAR program.
All copyrights to original unRAR code are owned by Alexander Roshal.
The license for original unRAR code has the following restriction:
The unRAR sources cannot be used to re-create the RAR compression algorithm,
which is proprietary. Distribution of modified unRAR sources in separate form
or as a part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.
--
Igor Pavlov
~~~
### AlphaFS
Chocolatey uses [AlphaFS](https://github.com/alphaleonis/AlphaFS) for long file paths. [License terms](https://github.com/alphaleonis/AlphaFS/blob/7e597b58a5109ee820766a176ffa489c1411b6aa/LICENSE.md):
~~~
The MIT License (MIT)
=====================
Copyright (c) 2008-2016 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
~~~
### Checksum
Chocolatey uses [Checksum](https://github.com/ferventcoder/checksum) to determine checksums. [License terms](https://github.com/ferventcoder/checksum/blob/e6f5645610c7bc15084b48f69d4cdb056106f956/LICENSE):
~~~
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
~~~
### log4net
Chocolatey uses [log4net](http://logging.apache.org/log4net/) for logging. [License terms](http://logging.apache.org/log4net/license.html):
~~~
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
~~~
### Microsoft.Web.Xdt
Chocolatey uses [Microsoft.Web.Xdt](https://www.nuget.org/packages/Microsoft.Web.xdt) to perform Xml Document Transformation. It is also a requirement of NuGet.Core. [License terms](https://www.microsoft.com/web/webpi/eula/microsoft_web_xmltransform.htm):
~~~
MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT.WEB.XDT
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft
· updates,
· supplements,
· Internet-based services, and
· support services
for this software, unless other terms accompany those items. If so, those terms apply.
By using the software, you accept these terms. If you do not accept them, do not use the software.
If you comply with these license terms, you have the perpetual rights below.
1. INSTALLATION AND USE RIGHTS. You may install and use any number of copies of the software on your devices.
2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a. Distributable Code. The software contains code that you are permitted to distribute in programs you develop if you comply with the terms below.
i. Right to Use and Distribute. You may copy and distribute the object code form of Microsoft.Web.XmlTransform.dll file.
· Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.
ii.Distribution Requirements. For any Distributable Code you distribute, you must
· add significant primary functionality to it in your programs;
· require distributors and external end users to agree to terms that protect it at least as much as this agreement;
· display your valid copyright notice on your programs; and
· indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs.
iii. Distribution Restrictions. You may not
· alter any copyright, trademark or patent notice in the Distributable Code;
· use Microsoft’s trademarks in your programs’ names or in a way that suggests your programs come from or are endorsed by Microsoft;
· distribute Distributable Code to run on a platform other than the Windows platform;
· include Distributable Code in malicious, deceptive or unlawful programs; or
· modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that
· the code be disclosed or distributed in source code form; or
· others have the right to modify it.
3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
· work around any technical limitations in the software;
· reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
· make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;
· publish the software for others to copy;
· rent, lease or lend the software; or
· transfer the software or this agreement to any third party.
4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software.
5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting.
7. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
9. APPLICABLE LAW.
a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
b. Outside the United States. If you acquired the software in any other country, the laws of that country apply.
10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
11. DISCLAIMER OF WARRANTY. The software is licensed “as-is.” You bear the risk of using it. Microsoft gives no express warranties, guarantees or conditions. You may have additional consumer rights or statutory guarantees under your local laws which this agreement cannot change. To the extent permitted under your local laws, Microsoft excludes the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
FOR AUSTRALIA – You have statutory guarantees under the Australian Consumer Law and nothing in these terms is intended to affect those rights.
12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. You can recover from Microsoft and its suppliers only direct damages up to U.S. $5.00. You cannot recover any other damages, including consequential, lost profits, special, indirect or incidental damages.
This limitation applies to
· anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
· claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
~~~
### NuGet.Core (modified)
Chocolatey uses [NuGet.Core](https://github.com/NuGet/NuGet2) [(modified)](https://github.com/chocolatey/nuget-chocolatey) to work with packaging. [License terms](https://github.com/NuGet/NuGet2/blob/c3d1027a51b31fd0c41e9abbe90810cf1c924c9f/COPYRIGHT.txt):
~~~
Copyright 2010-2014 Outercurve Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
~~~
### Rhino.Licensing (modified)
Chocolatey uses [Rhino.Licensing](https://github.com/ayende/rhino-licensing) [(modified)](https://github.com/ferventcoder/rhino-licensing) to work with licensing. [License terms](https://github.com/ayende/rhino-licensing/blob/1fc90c984b0c3012465a73afae0a53492c969eb5/license.txt):
~~~
Copyright (c) 2005 - 2009 Ayende Rahien ([email protected])
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Ayende Rahien nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
~~~
### Rx (Reactive Extensions)
Chocolatey uses [Rx](http://reactivex.io/) for schedules and internal messaging. [License terms](https://github.com/Reactive-Extensions/Rx.NET/blob/5003248b99f8bf4afc2d4f7570b5789cedda9155/LICENSE):
~~~
Copyright (c) .NET Foundation and Contributors
All Rights Reserved
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing permissions
and limitations under the License.
~~~
### Shim Generator (shimgen)
Chocolatey uses [shimgen](https://github.com/chocolatey/shimgen) to generate shim executables that call the original binaries. [License terms](https://github.com/chocolatey/choco/blob/782a1cd228df548661e6c4eb5bb49b347025f85a/src/chocolatey.resources/tools/shimgen.license.txt):
~~~
Shim Generator - shimgen.exe
Copyright (C) 2013 - 2017 RealDimensions Software, LLC ("RDS")
===================================================================
Grant of License
===================================================================
You may use Shim Generator ("shimgen.exe") only with the official Chocolatey
client. The use of shimgen.exe for any other reason is strictly prohibited.
If you would like to use this software for any other reason, you must obtain a
personal or commercial license to do so. To do that you must contact RDS at
ferventcoder.com.
This software is not free to distribute apart from the Chocolatey client. If you
would like to distribute this software outside of use through Chocolatey, you
must receive written permission from the software owner.
===================================================================
End-User License Agreement
===================================================================
EULA - Shim Generator
IMPORTANT- READ CAREFULLY: This RealDimensions Software ("RDS") End-User License
Agreement ("EULA") is a legal agreement between you ("END USER") and RDS for all
RDS products, controls, source code, demos, intermediate files, media, printed
materials, and "online" or electronic documentation ("SOFTWARE PRODUCT(S)")
contained with this distribution.
RDS grants to END USER as an individual, a personal, nonexclusive license to
install and use the SOFTWARE PRODUCT(S) for the sole purpose of use with the
official Chocolatey client. By installing, copying, or otherwise using the
SOFTWARE PRODUCT(S), END USER agrees to be bound by the terms of this EULA. If
END USER does not agree to any part of the terms of this EULA, DO NOT INSTALL,
USE, OR EVALUATE, ANY PART, FILE OR PORTION OF THE SOFTWARE PRODUCT(S).
ALL SOFTWARE PRODUCT(S) are licensed not sold. If END USER is an individual,
END USER must acquire an individual license for the SOFTWARE PRODUCT(S) from RDS
or its authorized resellers. If END USER is an entity, END USER must acquire an
individual license for each machine running the SOFTWARE PRODUCT(S) within your
organization from RDS or its authorized resellers. Both Virtual and Physical
Machines running the SOFTWARE PRODUCT(S) must be counted in the SOFTWARE
PRODUCT(S) licenses quantity of the organization.
===================================================================
Commercial / Personal Licensing
===================================================================
Shim Generator (shimgen.exe) is also offered under personal and commercial
licenses. You can learn more about this option by contacting RDS at
http://ferventcoder.com
~~~
### SimpleInjector
Chocolatey uses [SimpleInjector](https://simpleinjector.org/) for IoC containers. [License Terms](https://github.com/simpleinjector/SimpleInjector/blob/0687195a7691363d4b4918e36b5e4d708e88253c/licence.txt):
~~~
Copyright (c) 2013 - 2017 Simple Injector Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without
limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
~~~
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2011 - 2017 RealDimensions Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if (Get-Module chocolateyProfile) { return }
$thisDirectory = (Split-Path -parent $MyInvocation.MyCommand.Definition)
. $thisDirectory\functions\Write-FunctionCallLogMessage.ps1
. $thisDirectory\functions\Get-EnvironmentVariable.ps1
. $thisDirectory\functions\Get-EnvironmentVariableNames.ps1
. $thisDirectory\functions\Update-SessionEnvironment.ps1
. $thisDirectory\ChocolateyTabExpansion.ps1
Export-ModuleMember -Alias refreshenv -Function 'Update-SessionEnvironment', 'TabExpansion'
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC1tF/9TLC2W6vn
# Dr1z1KgttvltqVjbR0K5IMLo2fawG6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj6YgsIJWuHEqH
# CN8M9eJNYBi+qsSyrnAxZjNxPqxwoqvOf+l8y5Kh5TsxHM/q8grkV7tKtel05iv+
# bMt+dDk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JBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDM3WjAjBgkqhkiG9w0BCQQxFgQUgXCvVWZV1FfWOjhX
# D7WkwyRD2KkwDQYJKoZIhvcNAQEBBQAEggEAM/q2cYescDyFOENrJDih3RY4TMtZ
# RR4EXJbjI1cUa4BSpOzVCYR0obGeq+C3T4qj5snDBtrq5rNDWC80hRxXAm8GCSwK
# nsdRS12rBzgDr09EzdNqCzvc2+LW3w6AeQLbqID529GHSCEPHg/W7UgH/VpSGIAH
# aUa8UowJh0sdemyat3TYWqXfUysDjrg209b83NWBbOkSxs8hcPbaR5t3Ae5RASeZ
# zmpVj1jEweAViTa7rdKQ+Lb1xfNOBgoOacwQkQ0CYEMY/1cIMPSu+vCY+o/aMOUm
# m9cFFjSULkomCPYOw8wSrHpPtAEbZRF1WLOh2yalRbb7PahLtt8e9uPnPQ==
# SIG # End signature block
param(
[alias("ia","installArgs")][string] $installArguments = '',
[alias("o","override","overrideArguments","notSilent")]
[switch] $overrideArgs = $false,
[alias("x86")][switch] $forceX86 = $false,
[alias("params","parameters","pkgParams")][string]$packageParameters = '',
[string]$packageScript
)
$global:DebugPreference = "SilentlyContinue"
if ($env:ChocolateyEnvironmentDebug -eq 'true') { $global:DebugPreference = "Continue"; }
$global:VerbosePreference = "SilentlyContinue"
if ($env:ChocolateyEnvironmentVerbose -eq 'true') { $global:VerbosePreference = "Continue"; $verbosity = $true }
Write-Debug "Running 'ChocolateyScriptRunner' for $($env:packageName) v$($env:packageVersion) with packageScript `'$packageScript`', packageFolder:`'$($env:packageFolder)`', installArguments: `'$installArguments`', packageParameters: `'$packageParameters`',"
## Set the culture to invariant
$currentThread = [System.Threading.Thread]::CurrentThread;
$culture = [System.Globalization.CultureInfo]::InvariantCulture;
$currentThread.CurrentCulture = $culture;
$currentThread.CurrentUICulture = $culture;
$RunNote = "DarkCyan"
$Warning = "Magenta"
$ErrorColor = "Red"
$Note = "Green"
$version = $env:packageVersion
$packageName = $env:packageName
$packageVersion = $env:packageVersion
$packageFolder = $env:packageFolder
$helpersPath = (Split-Path -parent $MyInvocation.MyCommand.Definition);
$nugetChocolateyPath = (Split-Path -parent $helpersPath)
$nugetPath = $nugetChocolateyPath
$nugetExePath = Join-Path $nuGetPath 'bin'
$nugetLibPath = Join-Path $nuGetPath 'lib'
$badLibPath = Join-Path $nuGetPath 'lib-bad'
$extensionsPath = Join-Path $nugetPath 'extensions'
$chocInstallVariableName = "ChocolateyInstall"
$chocoTools = Join-Path $nuGetPath 'tools'
$nugetExe = Join-Path $chocoTools 'nuget.exe'
$7zip = Join-Path $chocoTools '7z.exe'
$ShimGen = Join-Path $chocoTools 'shimgen.exe'
$checksumExe = Join-Path $chocoTools 'checksum.exe'
Write-Debug "Running `'$packageScript`'";
& "$packageScript"
$scriptSuccess = $?
$lastExecutableExitCode = $LASTEXITCODE
if ($lastExecutableExitCode -ne $null -and $lastExecutableExitCode -ne '') {
Write-Debug "The last executable that ran had an exit code of '$lastExecutableExitCode'."
}
if (-not $scriptSuccess) {
Write-Debug "The script exited with a failure."
}
$exitCode = 0
if ($env:ChocolateyCheckLastExitCode -ne $null -and $env:ChocolateyCheckLastExitCode -eq 'true' -and $lastExecutableExitCode -ne $null -and $lastExecutableExitCode -ne '') {
$exitCode = $lastExecutableExitCode
}
if ($exitCode -eq 0 -and -not $scriptSuccess) {
$exitCode = 1
}
if ($env:ChocolateyExitCode -ne $null -and $env:ChocolateyExitCode -ne '') {
$exitCode = $env:ChocolateyExitCode
}
if ($exitCode -ne $null -and $exitCode -ne '' -and $exitCode -ne 0) {
Set-Power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20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDM3WjAjBgkqhkiG9w0BCQQxFgQUi2WUgaHHcLmaYxJN
# y8dYfYfZkf0wDQYJKoZIhvcNAQEBBQAEggEAh8TS1zaskVUaDAKxuXEgGFncDcYC
# wsBWNBMDPsaynCE6mFr+FnnDtxv0Oi++iBemA4UADQjsr3ElueQ9kMF3qHK22oPc
# fWMHeer3su08druiviQo09EX6p9uXhH5BUtSyhXiefBj2Gh0Pa8+/LGvf9dKA45n
# TlnACuvi/Wlh/ffpoQnREl22b9KSnVCpNTElHn3IYWB+4cEVn3BPEm6+jzncLM2F
# Lnv/2UCibJrUhptZnuToxdsNgNb0IkZ2Avk6oNOx6gwVVRCRXuOK2M4Z6IPuR6WC
# ZEwg5T+EpGGgWHkFl7m9Kg6hQIK2M8SVcBQ1A7oxzH6c2uetSMSkt+zGAA==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2011 - 2017 RealDimensions Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Ideas from the Awesome Posh-Git - https://github.com/dahlbyk/posh-git
# Posh-Git License - https://github.com/dahlbyk/posh-git/blob/1941da2472eb668cde2d6a5fc921d5043a024386/LICENSE.txt
# http://www.jeremyskinner.co.uk/2010/03/07/using-git-with-windows-powershell/
$Global:ChocolateyTabSettings = New-Object PSObject -Property @{
AllCommands = $false
}
$script:choco = "$env:ChocolateyInstall\choco.exe"
function script:chocoCmdOperations($commands, $command, $filter, $currentArguments) {
$currentOptions = @('zzzz')
if ($currentArguments -ne $null -and $currentArguments.Trim() -ne '') { $currentOptions = $currentArguments.Trim() -split ' ' }
$commands.$command.Replace(" "," ") -split ' ' |
where { $_ -notmatch "^(?:$($currentOptions -join '|' -replace "=", "\="))(?:\S*)\s?$" } |
where { $_ -like "$filter*" }
}
$script:someCommands = @('-?','search','list','info','install','outdated','upgrade','uninstall','new','download','pack','push','sync','-h','--help','pin','source','config','feature','apikey')
$allcommands = " --debug --verbose --force --noop --help --accept-license --confirm --limit-output --no-progress --execution-timeout= --cache-location='' --proxy='' --proxy-user= --proxy-password= --proxy-bypass-list='' --proxy-bypass-on-local --fail-on-error-output --use-system-powershell"
$proInstallUpgradeOptions = " --install-directory='' --max-download-rate= --install-arguments-sensitive= --package-parameters-sensitive= --skip-download-cache --use-download-cache --skip-virus-check --virus-check --virus-positives-minimum="
$proNewOptions = " --file='' --build-package --file64='' --from-programs-and-features --use-original-location --keep-remote --url='' --url64='' --checksum= --checksum64= --checksumtype= --pause-on-error"
$proUninstallOptions = " --from-programs-and-features"
$commandOptions = @{
list = "--lo --pre --exact --by-id-only --id-starts-with --detailed --approved-only --not-broken --source='' --user= --password= --local-only --prerelease --include-programs --page= --page-size= --order-by-popularity --download-cache-only" + $allcommands
search = "--pre --exact --by-id-only --id-starts-with --detailed --approved-only --not-broken --source='' --user= --password= --local-only --prerelease --include-programs --page= --page-size= --order-by-popularity --download-cache-only" + $allcommands
info = "--pre --lo --source='' --user= --password= --local-only --prerelease" + $allcommands
install = "-y -whatif -? --pre --version= --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --source='webpi' --user= --password= --prerelease --forcex86 --not-silent --package-parameters='' --allow-downgrade --force-dependencies --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --allow-multiple-versions --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --stop-on-first-package-failure" + $proInstallUpgradeOptions + $allcommands
pin = "--name= --version= -?" + $allcommands
outdated = "-? --source='' --user= --password=" + $allcommands
upgrade = "-y -whatif -? --pre --version= --except='' --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --source='webpi' --user= --password= --prerelease --forcex86 --not-silent --package-parameters='' --allow-downgrade --allow-multiple-versions --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --fail-on-unfound --fail-on-not-installed --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --exclude-prerelease --stop-on-first-package-failure --use-remembered-options --ignore-remembered-options" + $proInstallUpgradeOptions + $allcommands
uninstall = "-y -whatif -? --force-dependencies --remove-dependencies --all-versions --source='windowsfeatures' --source='webpi' --version= --uninstall-arguments='' --override-arguments --not-silent --params='' --package-parameters='' --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --use-autouninstaller --skip-autouninstaller --fail-on-autouninstaller --ignore-autouninstaller-failure --stop-on-first-package-failure" + $proUninstallOptions + $allcommands
new = "--template-name= --output-directory='' --automaticpackage --version= --maintainer='' packageversion= maintainername='' maintainerrepo='' installertype= url='' url64='' silentargs='' --use-built-in-template -?" + $proNewOptions + $allcommands
pack = "--version= -?" + $allcommands
push = "--source='' --api-key= --timeout= -?" + $allcommands
source = "--name= --source='' --user= --password= --priority= --bypass-proxy --allow-self-service -?" + $allcommands
config = "--name= --value= -?" + $allcommands
feature = "--name= -?" + $allcommands
apikey = "--source='' --api-key= -?" + $allcommands
download = "--internalize --ignore-dependencies --resources-location= --download-location= --outputdirectory= --source='' --version='' --prerelease --user= --password= --cert='' --certpassword= --append-use-original-location --recompile -?" + $allcommands
sync = "--output-directory= --id= -?" + $allcommands
}
try {
# if license exists
# add in pro/biz switches
}
catch {
}
function script:chocoCommands($filter) {
$cmdList = @()
if (-not $global:ChocolateyTabSettings.AllCommands) {
$cmdList += $someCommands -like "$filter*"
} else {
$cmdList += (& $script:choco -h) |
where { $_ -match '^ \S.*' } |
foreach { $_.Split(' ', [StringSplitOptions]::RemoveEmptyEntries) } |
where { $_ -like "$filter*" }
}
$cmdList #| sort
}
function script:chocoLocalPackages($filter) {
if ($filter -ne $null -and $filter.StartsWith(".")) { return; } #file search
@(& $script:choco list $filter -lo -r --id-starts-with) | %{ $_.Split('|')[0] }
}
function script:chocoLocalPackagesUpgrade($filter) {
if ($filter -ne $null -and $filter.StartsWith(".")) { return; } #file search
@('all|') + @(& $script:choco list $filter -lo -r --id-starts-with) | where { $_ -like "$filter*" } | %{ $_.Split('|')[0] }
}
function script:chocoRemotePackages($filter) {
if ($filter -ne $null -and $filter.StartsWith(".")) { return; } #file search
@('packages.config|') + @(& $script:choco search $filter --page=0 --page-size=30 -r --id-starts-with --order-by-popularity) | where { $_ -like "$filter*" } | %{ $_.Split('|')[0] }
}
function Get-AliasPattern($exe) {
$aliases = @($exe) + @(Get-Alias | where { $_.Definition -eq $exe } | select -Exp Name)
"($($aliases -join '|'))"
}
function ChocolateyTabExpansion($lastBlock) {
switch -regex ($lastBlock -replace "^$(Get-AliasPattern choco) ","") {
# Handles uninstall package names
"^uninstall\s+(?<package>[^\.][^-\s]*)$" {
chocoLocalPackages $matches['package']
}
# Handles install package names
"^(install)\s+(?<package>[^\.][^-\s]+)$" {
chocoRemotePackages $matches['package']
}
# Handles upgrade / uninstall package names
"^upgrade\s+(?<package>[^\.][^-\s]*)$" {
chocoLocalPackagesUpgrade $matches['package']
}
# Handles list/search first tab
"^(list|search)\s+(?<subcommand>[^-\s]*)$" {
@('<filter>','-?') | where { $_ -like "$($matches['subcommand'])*" }
}
# Handles new first tab
"^(new)\s+(?<subcommand>[^-\s]*)$" {
@('<name>','-?') | where { $_ -like "$($matches['subcommand'])*" }
}
# Handles pack first tab
"^(pack)\s+(?<subcommand>[^-\s]*)$" {
@('<PathtoNuspec>','-?') | where { $_ -like "$($matches['subcommand'])*" }
}
# Handles push first tab
"^(push)\s+(?<subcommand>[^-\s]*)$" {
@('<PathtoNupkg>','-?') | where { $_ -like "$($matches['subcommand'])*" }
}
# Handles source first tab
"^(source)\s+(?<subcommand>[^-\s]*)$" {
@('list','add','remove','disable','enable','-?') | where { $_ -like "$($matches['subcommand'])*" }
}
# Handles pin first tab
"^(pin)\s+(?<subcommand>[^-\s]*)$" {
@('list','add','remove','-?') | where { $_ -like "$($matches['subcommand'])*" }
}
# Handles feature first tab
"^(feature)\s+(?<subcommand>[^-\s]*)$" {
@('list','disable','enable','-?') | where { $_ -like "$($matches['subcommand'])*" }
}
# Handles config first tab
"^(config)\s+(?<subcommand>[^-\s]*)$" {
@('list','get','set','unset','-?') | where { $_ -like "$($matches['subcommand'])*" }
}
# Handles more options after others
"^(?<cmd>$($commandOptions.Keys -join '|'))(?<currentArguments>.*)\s+(?<op>\S*)$" {
chocoCmdOperations $commandOptions $matches['cmd'] $matches['op'] $matches['currentArguments']
}
# Handles choco <cmd> <op>
"^(?<cmd>$($commandOptions.Keys -join '|'))\s+(?<op>\S*)$" {
chocoCmdOperations $commandOptions $matches['cmd'] $matches['op']
}
# Handles choco <cmd>
"^(?<cmd>\S*)$" {
chocoCommands $matches['cmd']
}
}
}
$PowerTab_RegisterTabExpansion = if (Get-Module -Name powertab) { Get-Command Register-TabExpansion -Module powertab -ErrorAction SilentlyContinue }
if ($PowerTab_RegisterTabExpansion)
{
& $PowerTab_RegisterTabExpansion "choco" -Type Command {
param($Context, [ref]$TabExpansionHasOutput, [ref]$QuoteSpaces) # 1:
$line = $Context.Line
$lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart()
$TabExpansionHasOutput.Value = $true
ChocolateyTabExpansion $lastBlock
}
return
}
if (Test-Path Function:\TabExpansion) {
Rename-Item Function:\TabExpansion TabExpansionBackup
}
function TabExpansion($line, $lastWord) {
$lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart()
switch -regex ($lastBlock) {
# Execute Chocolatey tab completion for all choco-related commands
"^$(Get-AliasPattern choco) (.*)" { ChocolateyTabExpansion $lastBlock }
# Fall back on existing tab expansion
default { if (Test-Path Function:\TabExpansionBackup) { TabExpansionBackup $line $lastWord } }
}
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDX594sVFH4VZPJ
# Izj8qGsDVgugtM3xXcjgyTfYu68QV6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj6YgsIJWuHEqH
# CN8M9eJNYBi+q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GCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDM3WjAjBgkqhkiG9w0BCQQxFgQU/24BTOXeI4fUj/r9
# ojy5r1SD2ecwDQYJKoZIhvcNAQEBBQAEggEAQf8ZW/qQdwzEyq8iT9hVWjVpzUfB
# 1sjc0DnwNyZp7diRPbFgtX8S05xeqX/VVRLFjquCU+uJrRwHMPj8qJ+cLEKcGXVO
# KGMEMp8gDAvfO5fFlcoEwH+opp3nRSyoWDN0dzIH1cvDmUUKPYlaR9MN4xe33Uuu
# S/nIm0YOmdZr9HyGUYzzyJ9moVG7YlY2DAFCuUytcwghfm2lJn++cetDUNEiDCMP
# CHt4zaj8LHaZ8oQDIBnCg527kAwZUgDABkf5YdLHEXYdWy40l5l9iO2BEIlbxmNs
# ViYwGNWw04qLvEhsBWi485YnM+tPG1+a5zb7lyQlWn1y++F53K3Hhxu3ug==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2011 - 2017 RealDimensions Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Function Format-FileSize {
<#
.SYNOPSIS
DO NOT USE. Not part of the public API.
.DESCRIPTION
Formats file size into a human readable format.
.NOTES
Available in 0.9.10+.
This function is not part of the API.
.INPUTS
None
.OUTPUTS
Returns a string representation of the file size in a more friendly
format based on the passed in bytes.
.PARAMETER Size
The size of a file in bytes.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Format-FileSize -Size $fileSizeBytes
.LINK
Get-WebFile
#>
param (
[Parameter(Mandatory=$true, Position=0)][double] $size,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
# Do not log function call, it interrupts the single line download progress output.
Foreach ($unit in @('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB')) {
If ($size -lt 1024) {
return [string]::Format("{0:0.##} {1}", $size, $unit)
}
$size /= 1024
}
return [string]::Format("{0:0.##} YB", $size)
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA01JC3YBeVVSFg
# kazl1tZuFooX8d0fWHIDrjDMhcXHJ6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXN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017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-ChecksumValid {
<#
.SYNOPSIS
Checks a file's checksum versus a passed checksum and checksum type.
.DESCRIPTION
Makes a determination if a file meets an expected checksum signature.
This function is usually used when comparing a file that is downloaded
from an official distribution point. If the checksum fails to match the
expected output, this function throws an error.
Checksums have been used for years as a means of verification. A
checksum hash is a unique value or signature that corresponds to the
contents of a file. File names and extensions can be altered without
changing the checksum signature. However if you changed the contents of
the file, even one character, the checksum will be different.
Checksums are used to provide as a means of cryptographically ensuring
the contents of a file have not been changed. While some cryptographic
algorithms, including MD5 and SHA1, are no longer considered secure
against attack, the goal of a checksum algorithm is to make it
extremely difficult (near impossible with better algorithms) to alter
the contents of a file (whether by accident or for malicious reasons)
and still result in the same checksum signature.
When verifying a checksum using a secure algorithm, if the checksum
matches the expected signature, the contents of the file are identical
to what is expected.
.NOTES
This uses the checksum.exe tool available separately at
https://chocolatey.org/packages/checksum.
Options that affect checksum verification:
* `--ignore-checksums` - skips checksumming
* `--allow-empty-checksums` - skips checksumming when the package is missing a checksum
* `--allow-empty-checksums-secure` - skips checksumming when the package is missing a checksum for secure (HTTPS) locations
* `--require-checksums` - requires checksums for both non-secure and secure locations
* `--download-checksum`, `--download-checksum-type` - allows user to pass their own checksums
* `--download-checksum-x64`, `--download-checksum-type-x64` - allows user to pass their own checksums
Features that affect checksum verification:
* `checksumFiles` - when turned off, skips checksumming
* `allowEmptyChecksums` - when turned on, skips checksumming when the package is missing a checksum
* `allowEmptyChecksumsSecure` - when turned on, skips checksumming when the package is missing a checksum for secure (HTTPS) locations
.INPUTS
None
.OUTPUTS
None
.PARAMETER File
The full path to a binary file that is checksummed and compared to the
passed Checksum parameter value.
.PARAMETER Checksum
The expected checksum hash value of the File resource. The checksum
type is covered by ChecksumType.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
**NOTE:** To determine checksums, you can get that from the original
site if provided. You can also use the [checksum tool available on
the community feed](https://chocolatey.org/packages/checksum) (`choco install checksum`)
and use it e.g. `checksum -t sha256 -f path\to\file`. Ensure you
provide checksums for all remote resources used.
.PARAMETER ChecksumType
The type of checkum that the file is validated with - 'md5', 'sha1',
'sha256' or 'sha512' - defaults to 'md5'.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Get-ChecksumValid -File $fileFullPath -CheckSum $checksum -ChecksumType $checksumType
.LINK
Get-ChocolateyWebFile
.LINK
Install-ChocolateyPackage
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $file,
[parameter(Mandatory=$false, Position=1)][string] $checksum = '',
[parameter(Mandatory=$false, Position=2)][string] $checksumType = 'md5',
[parameter(Mandatory=$false, Position=3)][string] $originalUrl = '',
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if ($env:ChocolateyIgnoreChecksums -eq 'true') {
Write-Warning "Ignoring checksums due to feature checksumFiles turned off or option --ignore-checksums set."
return
}
if ($checksum -eq '' -or $checksum -eq $null) {
$allowEmptyChecksums = $env:ChocolateyAllowEmptyChecksums
$allowEmptyChecksumsSecure = $env:ChocolateyAllowEmptyChecksumsSecure
if ($allowEmptyChecksums -eq 'true') {
Write-Debug "Empty checksums are allowed due to allowEmptyChecksums feature or option."
return
}
if ($originalUrl -ne $null -and $originalUrl.ToLower().StartsWith("https") -and $allowEmptyChecksumsSecure -eq 'true') {
Write-Debug "Download from HTTPS source with feature 'allowEmptyChecksumsSecure' enabled."
return
}
Write-Warning "Missing package checksums are not allowed (by default for HTTP/FTP, `n HTTPS when feature 'allowEmptyChecksumsSecure' is disabled) for `n safety and security reasons. Although we strongly advise against it, `n if you need this functionality, please set the feature `n 'allowEmptyChecksums' ('choco feature enable -n `n allowEmptyChecksums') `n or pass in the option '--allow-empty-checksums'. You can also pass `n checksums at runtime (recommended). See `choco install -?` for details."
Write-Debug "If you are a maintainer attempting to determine the checksum for packaging purposes, please run `n 'choco install checksum' and run 'checksum -t sha256 -f $file' `n Ensure you do this for all remote resources."
if ($env:ChocolateyPowerShellHost -eq 'true') {
$statement = "The integrity of the file '$([System.IO.Path]::GetFileName($file))'"
if ($originalUrl -ne $null -and $originalUrl -ne '') {
$statement += " from '$originalUrl'"
}
$statement += " has not been verified by a checksum in the package scripts."
$question = 'Do you wish to allow the install to continue (not recommended)?'
$choices = New-Object System.Collections.ObjectModel.Collection[System.Management.Automation.Host.ChoiceDescription]
$choices.Add((New-Object System.Management.Automation.Host.ChoiceDescription -ArgumentList '&Yes'))
$choices.Add((New-Object System.Management.Automation.Host.ChoiceDescription -ArgumentList '&No'))
$selection = $Host.UI.PromptForChoice($statement, $question, $choices, 1)
if ($selection -eq 0) { return }
}
if ($originalUrl -ne $null -and $originalUrl.ToLower().StartsWith("https")) {
throw "This package downloads over HTTPS but does not yet have package checksums to verify the package. We recommend asking the maintainer to add checksums to this package. In the meantime if you need this package to work correctly, please enable the feature allowEmptyChecksumsSecure, provide the runtime switch '--allow-empty-checksums-secure', or pass in checksums at runtime (recommended - see 'choco install -?' / 'choco upgrade -?' for details)."
} else {
throw "Empty checksums are no longer allowed by default for non-secure sources. Please ask the maintainer to add checksums to this package. In the meantime if you need this package to work correctly, please enable the feature allowEmptyChecksums, provide the runtime switch '--allow-empty-checksums', or pass in checksums at runtime (recommended - see 'choco install -?' / 'choco upgrade -?' for details). It is strongly advised against allowing empty checksums for non-internal HTTP/FTP sources."
}
}
if (!([System.IO.File]::Exists($file))) { throw "Unable to checksum a file that doesn't exist - Could not find file `'$file`'" }
if ($checksumType -eq $null -or $checksumType -eq ''){
$checksumType = 'md5'
}
if ($checksumType -ne 'sha1' -and $checksumType -ne 'sha256' -and $checksumType -ne 'sha512' -and $checksumType -ne 'md5') {
Write-Debug 'Setting checksumType to md5 due to non-set value or type is not specified correctly.'
throw "Checksum type '$checksumType' is unsupported. This type may be supported in a newer version of Chocolatey."
}
$checksumExe = Join-Path "$helpersPath" '..\tools\checksum.exe'
if (!([System.IO.File]::Exists($checksumExe))) {
Update-SessionEnvironment
$checksumExe = Join-Path "$env:ChocolateyInstall" 'tools\checksum.exe'
}
Write-Debug "checksum.exe found at `'$checksumExe`'"
$params = "-c=`"$checksum`" -t=`"$checksumType`" -f=`"$file`""
Write-Debug "Executing command ['$checksumExe' $params]"
$process = New-Object System.Diagnostics.Process
$process.StartInfo = New-Object System.Diagnostics.ProcessStartInfo($checksumExe, $params)
$process.StartInfo.UseShellExecute = $false
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
$process.Start() | Out-Null
$process.WaitForExit()
$exitCode = $process.ExitCode
$process.Dispose()
Write-Debug "Command [`'$checksumExe`' $params] exited with `'$exitCode`'."
if ($exitCode -ne 0) {
throw "Checksum for '$file' did not meet '$checksum' for checksum type '$checksumType'. Consider passing the actual checksums through with `--checksum --checksum64` once you validate the checksums are appropriate. A less secure option is to pass `--ignore-checksums` if necessary."
}
#$fileCheckSumActual = $md5Output.Split(' ')[0]
# if ($f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xGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDIyWjAjBgkqhkiG9w0BCQQxFgQUzroxmjMzyDySdFO6
# 0hKcgmPk6ucwDQYJKoZIhvcNAQEBBQAEggEAXbHYpisi6bWzaoB6IJROmAcAlayU
# CrKRmeQFYUQmIaFLO78Cx6yQdWgmxSAdKFvfaAXCa5Tqbb0ZV/VBSXYINidqD++q
# zgBVRNS842fuCyjPWAlx2E3/dudPm7ZDEgD4hncbem3dWAbhps5tDlQKp13RQis2
# wQ3Hxs8bgggAMN2yTp5kqMl+Bqv2U7aKK+aIkSHB7kGnx+QT1/6zmgMKDAt2Ryoi
# +423lSYaAr9xOBFqtIuliIIbN2SlV4V63ZoCmCugxDXZtr/2XtisoWFM2hY0V6mZ
# l2H5dlktw+hbZ6gchbeOo0UaNMKoqmT4WuKhG4iPmAvZxPHXh1BbkDc+VQ==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-ChocolateyUnzip {
<#
.SYNOPSIS
Unzips an archive file and returns the location for further processing.
.DESCRIPTION
This unzips files using the 7-zip command line tool 7z.exe.
Supported archive formats are listed at:
https://sevenzip.osdn.jp/chm/general/formats.htm
Prior to 0.9.10.1, 7za.exe was used. Supported archive formats for
7za.exe are: 7z, lzma, cab, zip, gzip, bzip2, and tar.
.INPUTS
None
.OUTPUTS
Returns the passed in $destination.
.NOTES
If extraction fails, an exception is thrown.
If you are embedding files into a package, ensure that you have the
rights to redistribute those files if you are sharing this package
publicly (like on the community feed). Otherwise, please use
Install-ChocolateyZipPackage to download those resources from their
official distribution points.
Starting in 0.9.10, will automatically call Set-PowerShellExitCode to
set the package exit code based on 7-zip's exit code.
.PARAMETER FileFullPath
This is the full path to the zip file. If embedding it in the package
next to the install script, the path will be like
`"$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\\file.zip"`
In 0.10.1+, `File` is an alias for FileFullPath.
This can be a 32-bit or 64-bit file. This is mandatory in earlier versions
of Chocolatey, but optional if FileFullPath64 has been provided.
.PARAMETER FileFullPath64
Full file path to a 64-bit native installer to run. Available in 0.10.4+.
If embedding in the package, you can get it to the path with
`"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\\INSTALLER_FILE"`
Provide this when you want to provide both 32-bit and 64-bit
installers or explicitly only a 64-bit installer (which will cause a package
install failure on 32-bit systems).
.PARAMETER Destination
This is a directory where you would like the unzipped files to end up.
If it does not exist, it will be created.
.PARAMETER SpecificFolder
OPTIONAL - This is a specific directory within zip file to extract.
.PARAMETER PackageName
OPTIONAL - This will faciliate logging unzip activity for subsequent
uninstalls
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
# Path to the folder where the script is executing
$toolsDir = (Split-Path -parent $MyInvocation.MyCommand.Definition)
Get-ChocolateyUnzip -FileFullPath "c:\someFile.zip" -Destination $toolsDir
.LINK
Install-ChocolateyZipPackage
#>
param(
[alias("file")][parameter(Mandatory=$false, Position=0)][string] $fileFullPath,
[parameter(Mandatory=$true, Position=1)][string] $destination,
[parameter(Mandatory=$false, Position=2)][string] $specificFolder,
[parameter(Mandatory=$false, Position=3)][string] $packageName,
[alias("file64")][parameter(Mandatory=$false)][string] $fileFullPath64,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$bitnessMessage = ''
$zipfileFullPath=$fileFullPath
if ((Get-ProcessorBits 32) -or $env:ChocolateyForceX86 -eq 'true') {
if (!$fileFullPath) { throw "32-bit archive is not supported for $packageName"; }
if ($fileFullPath64) { $bitnessMessage = '32-bit '; }
} elseif ($fileFullPath64) {
$zipfileFullPath = $fileFullPath64
$bitnessMessage = '64-bit '
}
if ($zipfileFullPath -eq '' -or $zipfileFullPath -eq $null) {
throw 'Package parameters incorrect, either FileFullPath or FileFullPath64 must be specified.'
}
if ($packageName) {
$packagelibPath = $env:ChocolateyPackageFolder
if (!(Test-Path -path $packagelibPath)) {
New-Item $packagelibPath -type directory
}
$zipFilename=split-path $zipfileFullPath -Leaf
$zipExtractLogFullPath= Join-Path $packagelibPath $zipFilename`.txt
}
if ($env:chocolateyPackageName -ne $null -and $env:chocolateyPackageName -eq $env:ChocolateyInstallDirectoryPackage) {
Write-Warning "Install Directory override not available for zip packages at this time.`n If this package also runs a native installer using Chocolatey`n functions, the directory will be honored."
}
Write-Host "Extracting $bitnessMessage$zipfileFullPath to $destination..."
if (![System.IO.Directory]::Exists($destination)) { [System.IO.Directory]::CreateDirectory($destination) | Out-Null }
$7zip = Join-Path "$helpersPath" '..\tools\7z.exe'
if (!([System.IO.File]::Exists($7zip))) {
Update-SessionEnvironment
$7zip = Join-Path "$env:ChocolateyInstall" 'tools\7z.exe'
}
$7zip = [System.IO.Path]::GetFullPath($7zip)
Write-Debug "7zip found at `'$7zip`'"
# 32-bit 7z would not find C:\Windows\System32\config\systemprofile\AppData\Local\Temp,
# because it gets translated to C:\Windows\SysWOW64\... by the WOW redirection layer.
# Replace System32 with sysnative, which does not get redirected.
# 32-bit 7z is required so it can see both architectures
if ([IntPtr]::Size -ne 4) {
$fileFullPathNoRedirection = $zipfileFullPath -ireplace ([regex]::Escape([Environment]::GetFolderPath('System'))),(Join-Path $Env:SystemRoot 'SysNative')
$destinationNoRedirection = $destination -ireplace ([regex]::Escape([Environment]::GetFolderPath('System'))),(Join-Path $Env:SystemRoot 'SysNative')
} else {
$fileFullPathNoRedirection = $zipfileFullPath
$destinationNoRedirection = $destination
}
$params = "x -aoa -bd -bb1 -o`"$destinationNoRedirection`" -y `"$fileFullPathNoRedirection`""
if ($specificfolder) {
$params += " `"$specificfolder`""
}
Write-Debug "Executing command ['$7zip' $params]"
# Capture 7z's output into a StringBuilder and write it out in blocks, to improve I/O performance.
$global:zipFileList = New-Object System.Text.StringBuilder
$global:zipDestinationFolder = $destination
# Redirecting output slows things down a bit.
$writeOutput = {
if ($EventArgs.Data -ne $null) {
$line = $EventArgs.Data
Write-Verbose "$line"
if ($line.StartsWith("- ")) {
$global:zipFileList.AppendLine($global:zipDestinationFolder + "\" + $line.Substring(2))
}
}
}
$writeError = {
if ($EventArgs.Data -ne $null) {
Write-Error "$($EventArgs.Data)"
}
}
$process = New-Object System.Diagnostics.Process
$process.EnableRaisingEvents = $true
Register-ObjectEvent -InputObject $process -SourceIdentifier "LogOutput_ChocolateyZipProc" -EventName OutputDataReceived -Action $writeOutput | Out-Null
Register-ObjectEvent -InputObject $process -SourceIdentifier "LogErrors_ChocolateyZipProc" -EventName ErrorDataReceived -Action $writeError | Out-Null
$process.StartInfo = new-object System.Diagnostics.ProcessStartInfo($7zip, $params)
$process.StartInfo.RedirectStandardOutput = $true
$process.StartInfo.RedirectStandardError = $true
$process.StartInfo.UseShellExecute = $false
$process.StartInfo.WorkingDirectory = Get-Location
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
$process.Start() | Out-Null
if ($process.StartInfo.RedirectStandardOutput) { $process.BeginOutputReadLine() }
if ($process.StartInfo.RedirectStandardError) { $process.BeginErrorReadLine() }
$process.WaitForExit()
# For some reason this forces the jobs to finish and waits for
# them to do so. Without this it never finishes.
Unregister-Event -SourceIdentifier "LogOutput_ChocolateyZipProc"
Unregister-Event -SourceIdentifier "LogErrors_ChocolateyZipProc"
# sometimes the process hasn't fully exited yet.
for ($loopCount=1; $loopCount -le 15; $loopCount++) {
if ($process.HasExited) { break; }
Write-Debug "Waiting for 7z.exe process to exit - $loopCount/15 seconds";
Start-Sleep 1;
}
$exitCode = $process.ExitCode
$process.Dispose()
Set-PowerShellExitCode $exitCode
Write-Debug "Command ['$7zip' $params] exited with `'$exitCode`'."
if ($zipExtractLogFullPath) {
Set-Content $zipExtractLogFullPath $global:zipFileList.ToString() -Encoding UTF8 -Force
}
Write-Debug "7z exit code: $exitCode"
switch ($exitCode) {
0 { break }
1 { throw 'Some files could not be extracted' } # this one is returned e.g. for access denied errors
2 { throw '7-Zip encountered a fatal error while extracting the files' }
7 { throw '7-Zip command line error' }
8 { throw '7-Zip out of memory' }
255 { throw 'Extraction cancelled by the user' }
default { throw "7-Zip signalled an unknown error (code $exitCode)" }
}
$env:ChocolateyPackageInstallLocation = $destination
return $destination
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB2FWwtuQQfjYzA
# 4bYkIxeQ0BxUQ9k5F6dneeJk/X3xCqCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjI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ntVMF8+NH27KJ0711QbGaJq0YwR5pYuLF2SmX8E97r1p2OsMyZCoY2
# i54Ji6hY380b+NeR1fTXZGkUTy/xY7ekXjWi6pt2/Ckbpx6+67CKCOm3mg==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-ChocolateyWebFile {
<#
.SYNOPSIS
Downloads a file from the internets.
.DESCRIPTION
This will download a file from a url, tracking with a progress bar.
It returns the filepath to the downloaded file when it is complete.
.NOTES
Chocolatey works best when the packages contain the software it is
managing and doesn't require downloads. However most software in the
Windows world requires redistribution rights and when sharing packages
publicly (like on the community feed), maintainers may not have those
aforementioned rights. Chocolatey understands how to work with that,
hence this function. You are not subject to this limitation with
internal packages.
.PARAMETER PackageName
The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.
.PARAMETER FileFullPath
This is the full path of the resulting file name.
.PARAMETER Url
This is the 32 bit url to download the resource from. This resource can
be used on 64 bit systems when a package has both a Url and Url64bit
specified if a user passes `--forceX86`. If there is only a 64 bit url
available, please remove do not use the paramter (only use Url64bit).
Will fail on 32bit systems if missing or if a user attempts to force
a 32 bit installation on a 64 bit system.
Prefer HTTPS when available. Can be HTTP, FTP, or File URIs.
.PARAMETER Url64bit
OPTIONAL - If there is a 64 bit resource available, use this
parameter. Chocolatey will automatically determine if the user is
running a 64 bit OS or not and adjust accordingly. Please note that
the 32 bit url will be used in the absence of this. This parameter
should only be used for 64 bit native software. If the original Url
contains both (which is quite rare), set this to '$url' Otherwise
remove this parameter.
Prefer HTTPS when available. Can be HTTP, FTP, or File URIs.
In 0.10.1+, `Url64` is an alias for Url64bit.
.PARAMETER Checksum
The checksum hash value of the Url resource. This allows a checksum to
be validated for files that are not local. The checksum type is covered
by ChecksumType.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
.PARAMETER ChecksumType
The type of checkum that the file is validated with - valid
values are 'md5', 'sha1', 'sha256' or 'sha512' - defaults to 'md5'.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER Checksum64
OPTIONAL if no Url64bit - The checksum hash value of the Url64bit
resource. This allows a checksum to be validated for files that are not
local. The checksum type is covered by ChecksumType64.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
**NOTE:** To determine checksums, you can get that from the original
site if provided. You can also use the [checksum tool available on
the community feed](https://chocolatey.org/packages/checksum) (`choco install checksum`)
and use it e.g. `checksum -t sha256 -f path\to\file`. Ensure you
provide checksums for all remote resources used.
.PARAMETER ChecksumType64
OPTIONAL - The type of checkum that the file is validated with - valid
values are 'md5', 'sha1', 'sha256' or 'sha512' - defaults to
ChecksumType parameter value.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER Options
OPTIONAL - Specify custom headers. Available in 0.9.10+.
.PARAMETER GetOriginalFileName
OPTIONAL switch to allow Chocolatey to determine the original file name
from the url resource. Available in 0.9.10+.
.PARAMETER ForceDownload
OPTIONAL switch to force download of file every time, even if the file
already exists.
Available in 0.10.1+.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Get-ChocolateyWebFile '__NAME__' 'C:\somepath\somename.exe' 'URL' '64BIT_URL_DELETE_IF_NO_64BIT'
.EXAMPLE
>
# Download from an HTTPS location
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Get-ChocolateyWebFile -PackageName 'bob' -FileFullPath "$toolsDir\bob.exe" -Url 'https://somewhere/bob.exe'
.EXAMPLE
>
# Download from FTP
$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)"
Get-ChocolateyWebFile -PackageName 'bob' -FileFullPath "$toolsDir\bob.exe" -Url 'ftp://somewhere/bob.exe'
.EXAMPLE
>
# Download from a file share
$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)"
Get-ChocolateyWebFile -PackageName 'bob' -FileFullPath "$toolsDir\bob.exe" -Url 'file:///\\fileshare\location\bob.exe'
.EXAMPLE
>
$options =
@{
Headers = @{
Accept = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
'Accept-Charset' = 'ISO-8859-1,utf-8;q=0.7,*;q=0.3';
'Accept-Language' = 'en-GB,en-US;q=0.8,en;q=0.6';
Cookie = 'requiredinfo=info';
Referer = 'https://somelocation.com/';
}
}
Get-ChocolateyWebFile -PackageName 'package' -FileFullPath "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\thefile.exe" -Url 'https://somelocation.com/thefile.exe' -Options $options
.LINK
Install-ChocolateyPackage
.LINK
Get-WebFile
.LINK
Get-WebFileName
.LINK
Get-FtpFile
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $packageName,
[parameter(Mandatory=$true, Position=1)][string] $fileFullPath,
[parameter(Mandatory=$false, Position=2)][string] $url = '',
[parameter(Mandatory=$false, Position=3)]
[alias("url64")][string] $url64bit = '',
[parameter(Mandatory=$false)][string] $checksum = '',
[parameter(Mandatory=$false)][string] $checksumType = '',
[parameter(Mandatory=$false)][string] $checksum64 = '',
[parameter(Mandatory=$false)][string] $checksumType64 = $checksumType,
[parameter(Mandatory=$false)][hashtable] $options = @{Headers=@{}},
[parameter(Mandatory=$false)][switch] $getOriginalFileName,
[parameter(Mandatory=$false)][switch] $forceDownload,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
# url overrides
$urlOverride = $env:ChocolateyUrlOverride
$url64bitOverride = $env:ChocolateyUrl64bitOverride
if ($urlOverride -ne $null -and $urlOverride -ne '') { $url = $urlOverride }
if ($url64bitOverride -ne $null -and $url64bitOverride -ne '') { $url64bit = $url64bitOverride }
if ($url -ne $null) { $url = $url.Replace("//","/").Replace(":/","://") }
if ($url64bit -ne $null) { $url64bit = $url64bit.Replace("//","/").Replace(":/","://") }
$url32bit = $url
# allow user provided values for checksumming
$checksum32Override = $env:chocolateyChecksum32
$checksumType32Override = $env:chocolateyChecksumType32
$checksum64Override = $env:chocolateyChecksum64
$checksumType64Override = $env:chocolateyChecksumType64
if ($checksum32Override -ne $null -and $checksum32Override -ne '') { $checksum = $checksum32Override }
if ($checksumType32Override -ne $null -and $checksumType32Override -ne '') { $checksumType = $checksumType32Override }
if ($checksum64Override -ne $null -and $checksum64Override -ne '') { $checksum64 = $checksum64Override }
if ($checksumType64Override -ne $null -and $checksumType64Override -ne '') { $checksumType64 = $checksumType64Override }
$checksum32 = $checksum
$checksumType32 = $checksumType
$bitWidth = 32
if (Get-ProcessorBits 64) {
$bitWidth = 64
}
Write-Debug "CPU is $bitWidth bit"
$bitPackage = ''
if ($url32bit -ne $url64bit -and $url64bit -ne $null -and $url64bit -ne '') { $bitPackage = '32 bit' }
if ($bitWidth -eq 64 -and $url64bit -ne $null -and $url64bit -ne '') {
Write-Debug "Setting url to '$url64bit' and bitPackage to $bitWidth"
$bitPackage = '64 bit'
$url = $url64bit
# only set if urls are different
if ($url32bit -ne $url64bit) {
$checksum = $checksum64
if ($checkSumType64 -ne '') {
$checksumType = $checksumType64
}
}
}
$forceX86 = $env:chocolateyForceX86;
if ($forceX86) {
Write-Debug "User specified -x86 so forcing 32 bit"
if ($url32bit -ne $url64bit) { $bitPackage = '32 bit' }
$url = $url32bit
$checksum = $checksum32
$checksumType = $checksumType32
}
# If we're on 32 bit or attempting to force 32 bit and there is no
# 32 bit url, we need to throw an error.
if ($url -eq $null -or $url -eq '') {
throw "This package does not support $bitWidth bit architecture."
}
# determine if the url can be SSL/TLS
if ($url.StartsWith('http:')) {
try {
$httpsUrl = $url.Replace("http://", "https://")
Get-WebHeaders -Url $httpsUrl -ErrorAction "Stop" | Out-Null
$url = $httpsUrl
Write-Warning "Url has SSL/TLS available, switching to HTTPS for download"
} catch {
Write-Debug "Url does not have HTTPS available"
}
}
if ($getOriginalFileName) {
try {
$fileFullPath = $fileFullPath -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'
$fileDirectory = [System.IO.Path]::GetDirectoryName($fileFullPath)
$originalFileName = [System.IO.Path]::GetFileName($fileFullPath)
$fileFullPath = Get-WebFileName -Url $url -DefaultName $originalFileName
$fileFullPath = Join-Path $fileDirectory $fileFullPath
$fileFullPath = [System.IO.Path]::GetFullPath($fileFullPath)
} catch {
Write-Host "Attempt to use original download file name failed for '$url'."
}
}
try {
$fileDirectory = $([System.IO.Path]::GetDirectoryName($fileFullPath))
if (!(Test-Path($fileDirectory))) {
[System.IO.Directory]::CreateDirectory($fileDirectory) | Out-Null
}
} catch {
Write-Host "Attempt to create directory failed for '$fileFullPath'."
}
$urlIsRemote = $true
$headers = @{}
if ($url.StartsWith('http')) {
try {
$headers = Get-WebHeaders -Url $url -ErrorAction "Stop"
} catch {
if ($host.Version -lt (New-Object 'Version' 3,0)) {
Write-Debug "Converting Security Protocol to SSL3 only for Powershell v2"
# this should last for the entire duration
$originalProtocol = [System.Net.ServicePointManager]::SecurityProtocol
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Ssl3
try {
$headers = Get-WebHeaders -Url $url -ErrorAction "Stop"
} catch {
Write-Host "Attempt to get headers for $url failed.`n $($_.Exception.Message)"
[System.Net.ServicePointManager]::SecurityProtocol = $originalProtocol
}
} else {
Write-Host "Attempt to get headers for $url failed.`n $($_.Exception.Message)"
}
}
$needsDownload = $true
$fiCached = New-Object System.IO.FileInfo($fileFullPath)
if ($fiCached.Exists -and -not ($forceDownload)) {
if ($checksum -ne $null -and $checksum -ne '') {
try {
Write-Host "File appears to be downloaded already. Verifying with package checksum to determine if it needs to be redownloaded."
Get-ChecksumValid -file $fileFullPath -checkSum $checksum -checksumType $checksumType -originalUrl $url -ErrorAction "Stop"
$needsDownload = $false
} catch {
Write-Debug "Existing file failed checksum. Will be redownloaded from url."
}
}
elseif ($headers.Count -ne 0 -and $headers.ContainsKey("Content-Length")) {
# if the file already exists there is no reason to download it again.
if ($fiCached.Length -eq $headers["Content-Length"]) { $needsDownload = $false }
}
}
if ($needsDownload) {
Write-Host "Downloading $packageName $bitPackage
from `'$url`'"
Get-WebFile -Url $url -FileName $fileFullPath -Options $options
} else {
Write-Debug "$($packageName)'s requested file has already been downloaded. Using cached copy at
'$fileFullPath'."
}
} elseif ($url.StartsWith('ftp')) {
Write-Host "Ftp-ing $packageName
from '$url'"
Get-FtpFile -Url $url -FileName $fileFullPath
} else {
if ($url.StartsWith('file:')) { $url = ([uri] $url).LocalPath }
Write-Host "Copying $packageName
from `'$url`'"
Copy-Item $url -Destination $fileFullPath -Force
$urlIsRemote = $false
}
Start-Sleep 2 #give it a sec or two to finish up copying
$fi = New-Object System.IO.FileInfo($fileFullPath)
# validate file exists
if (!($fi.Exists)) { throw "Chocolatey expected a file to be downloaded to `'$fileFullPath`' but nothing exists at that location." }
Get-VirusCheckValid -Location $url -File $fileFullPath
if ($headers.Count -ne 0 -and ($checksum -eq $null -or $checksum -eq '')) {
# validate length is what we expected
Write-Debug "Checking that '$fileFullPath' is the size we expect it to be."
if ($headers.ContainsKey("Content-Length") -and ($fi.Length -ne $headers["Content-Length"])) { throw "Chocolatey expected a file at '$fileFullPath' to be of length '$($headers["Content-Length"])' but the length was '$($fi.Length)'." }
if ($headers.ContainsKey("X-Checksum-Sha1")) {
$remoteChecksum = $headers["X-Checksum-Sha1"]
Write-Debug "Verifying remote checksum of '$remoteChecksum' for '$fileFullPath'."
Get-ChecksumValid -File $fileFullPath -Checksum $remoteChecksum -ChecksumType 'sha1' -OriginalUrl $url
}
}
#skip requirement for embedded files if checksum is not provided
if ($urlIsRemote -or ($checksum -ne $null -and $checksum -ne '')) {
Write-Debug "Verifying package provided checksum of '$checksum' for '$fileFullPath'."
Get-ChecksumValid -File $fileFullPath -Checksum $checksum -ChecksumType $checksumType -OriginalUrl $url
}
return $fileFullPath
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCApjH4V1hECJn6U
# VMD8P8h4XqdYQFZtbh5A6CNjfTiU16CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZ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O+cOUKOijeev5efEUPOCvle
# pxkbvtBkyBic1iaFJV3ZcPB3i711urfN4zCVeRNP/xkm5L72+kEzShA1QKWZ3gae
# LG+tDArjbj7tlD0jeaLVlcLzi68bQM5+4r80Nr3nh2jth2BZu3o39WxznQ==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-EnvironmentVariable {
<#
.SYNOPSIS
Gets an Environment Variable.
.DESCRIPTION
This will will get an environment variable based on the variable name
and scope while accounting whether to expand the variable or not
(e.g.: `%TEMP%`-> `C:\User\Username\AppData\Local\Temp`).
.NOTES
This helper reduces the number of lines one would have to write to get
environment variables, mainly when not expanding the variables is a
must.
.PARAMETER Name
The environemnt variable you want to get the value from.
.PARAMETER Scope
The environemnt variable target scope. This is `Process`, `User`, or
`Machine`.
.PARAMETER PreserveVariables
A switch parameter stating whether you want to expand the variables or
not. Defaults to false. Available in 0.9.10+.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Get-EnvironmentVariable -Name 'TEMP' -Scope User -PreserveVariables
.EXAMPLE
Get-EnvironmentVariable -Name 'PATH' -Scope Machine
.LINK
Get-EnvironmentVariableNames
.LINK
Set-EnvironmentVariable
#>
[CmdletBinding()]
[OutputType([string])]
param(
[Parameter(Mandatory=$true)][string] $Name,
[Parameter(Mandatory=$true)][System.EnvironmentVariableTarget] $Scope,
[Parameter(Mandatory=$false)][switch] $PreserveVariables = $false,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
# Do not log function call, it may expose variable names
[string] $MACHINE_ENVIRONMENT_REGISTRY_KEY_NAME = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment\";
[Microsoft.Win32.RegistryKey] $win32RegistryKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($MACHINE_ENVIRONMENT_REGISTRY_KEY_NAME)
if ($Scope -eq [System.EnvironmentVariableTarget]::User) {
[string] $USER_ENVIRONMENT_REGISTRY_KEY_NAME = "Environment";
[Microsoft.Win32.RegistryKey] $win32RegistryKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($USER_ENVIRONMENT_REGISTRY_KEY_NAME)
} elseif ($Scope -eq [System.EnvironmentVariableTarget]::Process) {
return [Environment]::GetEnvironmentVariable($Name, $Scope)
}
[Microsoft.Win32.RegistryValueOptions] $registryValueOptions = [Microsoft.Win32.RegistryValueOptions]::None
if ($PreserveVariables) {
Write-Verbose "Choosing not to expand environment names"
$registryValueOptions = [Microsoft.Win32.RegistryValueOptions]::DoNotExpandEnvironmentNames
}
[string] $environmentVariableValue = [string]::Empty
try {
#Write-Verbose "Getting environment variable $Name"
if ($win32RegistryKey -ne $null) {
# Some versions of Windows do not have HKCU:\Environment
$environmentVariableValue = $win32RegistryKey.GetValue($Name, [string]::Empty, $registryValueOptions)
}
} catch {
Write-Debug "Unable to retrieve the $Name environment variable. Details: $_"
} finally {
if ($win32RegistryKey -ne $null) {
$win32RegistryKey.Close()
}
}
if ($environmentVariableValue -eq $null -or $environmentVariableValue -eq '') {
$environmentVariableValue = [Environment]::GetEnvironmentVariable($Name, $Scope)
}
return $environmentVariableValue
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBA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iG9w0BCQQxFgQUWG5kvl4g5ewP9zqe
# BhKR4Nf+kYcwDQYJKoZIhvcNAQEBBQAEggEANGPInaHJUjl1WxddTR/eY3eWmm/X
# J9zZeMnr1DMBQL/9sZGUDqzyrmcy5SQKba/v37ZWBJOF/Y4xR7n/se4a3KIe4frA
# DAeeefkGAIIYyLyDkmgNAyuzvO2kl7VprP4pL7wkf9eEpsK8dCTjOWzhy9c1b9Ty
# FtShhxCbVUbPaWTgDS0jDuxOr0NMyCaMeOIG4r7yzbe8AXZwpMlN2kKc08kuHauv
# wjK1/n3AiGucCWJumOWXOSTEkwpgxRtYIGJrvnPN/11N89J7pDWrI2y4soBRL1BW
# r1lxjDH4RJijdetInYOVpnr+HlXnJKj4ZgzQM08dHkBNv3GaEMOjVMNqHA==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-EnvironmentVariableNames([System.EnvironmentVariableTarget] $Scope) {
<#
.SYNOPSIS
Gets all environment variable names.
.DESCRIPTION
Provides a list of environment variable names based on the scope. This
can be used to loop through the list and generate names.
.NOTES
Process dumps the current environment variable names in memory /
session. The other scopes refer to the registry values.
.INPUTS
None
.OUTPUTS
A list of environment variables names.
.PARAMETER Scope
The environemnt variable target scope. This is `Process`, `User`, or
`Machine`.
.EXAMPLE
Get-EnvironmentVariableNames -Scope Machine
.LINK
Get-EnvironmentVariable
.LINK
Set-EnvironmentVariable
#>
# Do not log function call
# HKCU:\Environment may not exist in all Windows OSes (such as Server Core).
switch ($Scope) {
'User' { Get-Item 'HKCU:\Environment' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Property }
'Machine' { Get-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' | Select-Object -ExpandProperty Property }
'Process' { Get-ChildItem Env:\ | Select-Object -ExpandProperty Key }
default { throw "Unsupported environment scope: $Scope" }
}
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBYcNSJugYmbRlV
# mMWT7erzvVrOWcoJ4BHNYe4phzO8Z6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQz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+dWMamz
# rR1zmDRmDSr6ZuI+eFbu6p6L1agL2mGYWoGrzLYXiiYV+JJtneF5sqGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDI0WjAjBgkqhkiG9w0BCQQxFgQU6tmTgHU/P3oeF28a
# nIcVaPKdF10wDQYJKoZIhvcNAQEBBQAEggEAFgt6KMHF4Z+tRINZC6ln/mhqoWmw
# 1h2IQEpboEfCC0iKZK12duVdAXrgg6p3XoBwIKX5t42TzTLeb9kiedjrkUD8kBTX
# q/XLzom1KHTkRQ2uOUto1GmiYbXZKXbr0wbRHaIMHlpp2c422PtOUztmQfIMRPK2
# PT9gYiAIYMJXvPcgUL/mgmeG6gDJzZpmiYjeIe27BvEOFhgoLb7Jy1WZSk8gjwNb
# 3mC1LLQD689fW+bUiJAtVCX7YeUkKPE5hN3oQWYvXpOmsF/++LOcfndf9pM2JoIM
# lXfhsToGO8d6M2SkmQMJGMIXG0ZP/qJ75hF5XFR46U/R6HtolKorOCqrCA==
# SIG # End signature block
## Get-FtpFile
##############################################################################################################
## Downloads a file from ftp
## Some code from http://stackoverflow.com/questions/265339/whats-the-best-way-to-automate-secure-ftp-in-powershell
## Additional functionality emulated from http://poshcode.org/417 (Get-WebFile)
## Written by Stephen C. Austin, Pwnt & Co. http://pwnt.co
##############################################################################################################
## Additional functionality added by Chocolatey Team / Chocolatey Contributors
## - Proxy
## - Better error handling
## - Inline documentation
## - Cmdlet conversion
## - Closing request/response and cleanup
## - Request / ReadWriteResponse Timeouts
##############################################################################################################
function Get-FtpFile {
<#
.SYNOPSIS
Downloads a file from a File Transfter Protocol (FTP) location.
.DESCRIPTION
This will download a file from an FTP location, saving the file to the
FileName location specified.
.NOTES
This is a low-level function and not recommended for use in package
scripts. It is recommended you call `Get-ChocolateyWebFile` instead.
Starting in 0.9.10, will automatically call Set-PowerShellExitCode to
set the package exit code to 404 if the resource is not found.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Url
This is the url to download the file from.
.PARAMETER FileName
This is the full path to the file to create. If FTPing to the
package folder next to the install script, the path will be like
`"$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\\file.exe"`
.PARAMETER UserName
The user account to connect to FTP with.
.PARAMETER Password
The password for the user account on the FTP server.
.PARAMETER Quiet
Silences the progress output.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.LINK
Get-ChocolateyWebFile
.LINK
Get-WebFile
#>
param(
[parameter(Mandatory=$false, Position=0)][string] $url = '',
[parameter(Mandatory=$true, Position=1)][string] $fileName = $null,
[parameter(Mandatory=$false, Position=2)][string] $username = $null,
[parameter(Mandatory=$false, Position=3)][string] $password = $null,
[parameter(Mandatory=$false)][switch] $quiet,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if ($url -eq $null -or $url -eq '') {
Write-Warning "Url parameter is empty, Get-FtpFile has nothing to do."
return
}
if ($fileName -eq $null -or $fileName -eq '') {
Write-Warning "FileName parameter is empty, Get-FtpFile cannot save the output."
return
}
try {
$uri = [System.Uri]$url
if ($uri.IsFile()) {
Write-Debug "Url is local file, setting destination"
if ($url.LocalPath -ne $fileName) {
Copy-Item $uri.LocalPath -Destination $fileName -Force
}
return
}
} catch {
#continue on
}
# Create a FTPWebRequest object to handle the connection to the ftp server
$ftprequest = [System.Net.FtpWebRequest]::create($url)
# check if a proxy is required
$explicitProxy = $env:chocolateyProxyLocation
$explicitProxyUser = $env:chocolateyProxyUser
$explicitProxyPassword = $env:chocolateyProxyPassword
$explicitProxyBypassList = $env:chocolateyProxyBypassList
$explicitProxyBypassOnLocal = $env:chocolateyProxyBypassOnLocal
if ($explicitProxy -ne $null) {
# explicit proxy
$proxy = New-Object System.Net.WebProxy($explicitProxy, $true)
if ($explicitProxyPassword -ne $null) {
$passwd = ConvertTo-SecureString $explicitProxyPassword -AsPlainText -Force
$proxy.Credentials = New-Object System.Management.Automation.PSCredential ($explicitProxyUser, $passwd)
}
if ($explicitProxyBypassList -ne $null -and $explicitProxyBypassList -ne '') {
$proxy.BypassList = $explicitProxyBypassList.Split(',', [System.StringSplitOptions]::RemoveEmptyEntries)
}
if ($explicitProxyBypassOnLocal -eq 'true') { $proxy.BypassProxyOnLocal = $true; }
Write-Host "Using explicit proxy server '$explicitProxy'."
$ftprequest.Proxy = $proxy
}
# set the request's network credentials for an authenticated connection
$ftprequest.Credentials = New-Object System.Net.NetworkCredential($username, $password)
$ftprequest.Method = [System.Net.WebRequestMethods+Ftp]::DownloadFile
$ftprequest.UseBinary = $true
$ftprequest.KeepAlive = $false
# use the default request timeout of 100000
if ($env:chocolateyRequestTimeout -ne $null -and $env:chocolateyRequestTimeout -ne '') {
$ftprequest.Timeout = $env:chocolateyRequestTimeout
}
if ($env:chocolateyResponseTimeout -ne $null -and $env:chocolateyResponseTimeout -ne '') {
$ftprequest.ReadWriteTimeout = $env:chocolateyResponseTimeout
}
try {
# send the ftp request to the server
$ftpresponse = $ftprequest.GetResponse()
[long]$goal = $ftpresponse.ContentLength
$goalFormatted = Format-FileSize $goal
# get a download stream from the server response
$reader = $ftpresponse.GetResponseStream()
# create the target file on the local system and the download buffer
$writer = New-Object IO.FileStream ($fileName,[IO.FileMode]::Create)
[byte[]]$buffer = New-Object byte[] 1048576
[long]$total = [long]$count = 0
$originalEAP = $ErrorActionPreference
$ErrorActionPreference = 'Stop'
try {
# loop through the download stream and send the data to the target file
do {
$count = $reader.Read($buffer, 0, $buffer.Length);
$writer.Write($buffer, 0, $count);
if(!$quiet) {
$total += $count
$totalFormatted = Format-FileSize $total
if($goal -gt 0) {
$percentComplete = [Math]::Truncate(($total/$goal)*100)
Write-Progress "Downloading $url to $fileName" "Saving $totalFormatted of $goalFormatted ($total/$goal)" -id 0 -percentComplete $percentComplete
} else {
Write-Progress "Downloading $url to $fileName" "Saving $total bytes..." -id 0 -Completed
}
if ($total -eq $goal -and $count -eq 0) {
Write-Progress "Completed download of $url." "Completed a total of $total bytes of $fileName" -id 0 -Completed -PercentComplete 100
}
}
} while ($count -ne 0)
Write-Host ""
Write-Host "Download of $([System.IO.Path]::GetFileName($fileName)) ($goalFormatted) completed."
} finally {
$ErrorActionPreference = $originalEAP
}
$writer.Flush() # closed in finally block
} catch {
if ($ftprequest -ne $null) {
$ftprequest.ServicePoint.MaxIdleTime = 0
$ftprequest.Abort();
# ruthlessly remove $ftprequest to ensure it isn't reused
Remove-Variable ftprequest
Start-Sleep 1
[GC]::Collect()
}
Set-PowerShellExitCode 404
if ($env:DownloadCacheAvailable -eq 'true') {
throw "The remote file either doesn't exist, is unauthorized, or is forbidden for url '$url'. $($_.Exception.Message) `nThis package is likely not broken for licensed users - see https://chocolatey.org/docs/features-private-cdn."
} else {
throw "The remote file either doesn't exist, is unauthorized, or is forbidden for url '$url'. $($_.Exception.Message)"
}
} finally {
if ($reader -ne $null) {
try { $reader.Close(); } catch {}
}
if ($writer -ne $null) {
try { $writer.Close(); } catch {}
}
if ($ftpresponse -ne $null) {
try { $ftpresponse.Close(); } catch {}
}
Start-Sleep 1
}
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCmQDCP9RNawhnG
# TM1ks0EpO5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hvcNAQEBBQAEggEAfeKSm/Wx+LI2MuPW3VP1oR6toedz
# Hfzy1Fc4amp3oT9p6ZJAZksljeBa6lFO6Q2VtZmWaOx4zSHTUP6nvAURzU0FmKYM
# oAx5hY2G+5cfe+PZkMkErzvIlgqYDh09Qr+T0+EU8T1ptTPub7UssKMhxio/RHx3
# G7w4ZL7njBcv4trYdwvwZ/rRBJmW0xSlvRvRjA7BapsOKYmVuD1WqhvIWPRhovYR
# vJRRKQoy0BXSG5MyA+F0iEmkwWi92U5K+cU+tR6uJEYYvANKvgfwz2A9oEPlpbId
# hU0vLM/rXBeu4s8V8fZLCkSkhoDxA/AOjkW7Jw+XMo1RJtoUBV5Cx8UXwA==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-OSArchitectureWidth {
<#
.SYNOPSIS
Get the operating system architecture address width.
.DESCRIPTION
This will return the system architecture address width (probably 32 or
64 bit). If you pass a comparison, it will return true or false instead
of {`32`|`64`}.
.NOTES
When your installation script has to know what architecture it is run
on, this simple function comes in handy.
Available as `Get-OSArchitectureWidth` in 0.9.10+. If you need
compatibility with pre 0.9.10, please use the alias `Get-ProcessorBits`.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Compare
This optional parameter causes the function to return $true or $false,
depending on wether or not the bit width matches.
#>
param(
$compare
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$bits = 64
if (([System.IntPtr]::Size -eq 4) -and (Test-Path env:\PROCESSOR_ARCHITEW6432)) {
$bits = 64
} elseif ([System.IntPtr]::Size -eq 4) {
$bits = 32
}
# Return bool|int
if ("$compare" -ne '' -and $compare -eq $bits) {
return $true
} elseif ("$compare" -ne '') {
return $false
} else {
return $bits
}
}
Set-Alias Get-ProcessorBits Get-OSArchitectureWidth
Set-Alias Get-OSBitness Get-OSArchitectureWidth
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC+5R24zufGXnsc
# mWj/25mf6jwe97cvRY7+8fCOG4I2J6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGn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# k5HtDbQzY344DN+tk2WxIYqBIzhqt5yaFjluXVX9CFS7eGFUaGT2d6GCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDI2WjAjBgkqhkiG9w0BCQQxFgQUBbIKZe4FM4gujPu3
# sTYP4zIKkR8wDQYJKoZIhvcNAQEBBQAEggEABiGpxl4FUBh7KDSzsyHxQhCM4UOp
# Kl+7QSnu5UvCGRpVeKkkABbVHE8WASyQAx9uhOKUYcqYh0KE4RST2fIrOc1/ZM3T
# OCf4PyZuDaSj36gxWw3u65jvdo9kM67rh6bsPQET6Ujmch0W37gPNeyaVLor0kBi
# 7tvnyNHEYgBNpgS4hxUenQ61CudiVYMj8sJYSsblkFctSNo5leqW64Vk2tL38FaC
# nugbU8PEO+2hJKA3rJsGsxgTKjv62tkY2iK1yWFNbcUef9C7X2Fkh4KEX32AG0dg
# 0Owqg3Z1yO7K0vdat5c57U1u8TUGipm5KuGIoBrmGk0OXey8jOIRqk6vvw==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2011 - 2017 RealDimensions Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-ToolsLocation {
<#
.SYNOPSIS
Gets the top level location for tools/software installed outside of
package folders.
.DESCRIPTION
Creates or uses an environment variable that a user can control to
communicate with packages about where they would like software that is
not installed through native installers, but doesn't make much sense
to be kept in package folders. Most software coming in packages stays
with the package itself, but there are some things that seem to fall
out of this category, like things that have plugins that are installed
into the same directory as the tool. Having that all combined in the
same package directory could get tricky.
.NOTES
This is the successor to the poorly named `Get-BinRoot`. Available as
`Get-ToolsLocation` in 0.9.10+. If you need compatibility with pre
0.9.10, please use `Get-BinRoot`.
Sets an environment variable called `ChocolateyToolsLocation`. If the
older `ChocolateyBinRoot` is set, it uses the value from that and
removes the older variable.
.INPUTS
None
.OUTPUTS
None
#>
$invocation = $MyInvocation
Write-FunctionCallLogMessage -Invocation $invocation -Parameters $PSBoundParameters
if ($invocation -ne $null -and $invocation.InvocationName -ne $null -and $invocation.InvocationName.ToLower() -eq 'get-binroot') {
Write-Host "Get-BinRoot is going to be deprecated in v1 and removed in v2. It has been replaced with Get-ToolsLocation (starting with v0.9.10), however many packages no longer require a special separate directory since package folders no longer have versions on them. Some do though and should continue to use Get-ToolsLocation."
}
$toolsLocation = $env:ChocolateyToolsLocation
if ($toolsLocation -eq $null) {
$binRoot = $env:ChocolateyBinRoot
$olderRoot = $env:chocolatey_bin_root
if ($binRoot -eq $null -and $olderRoot -eq $null) {
$toolsLocation = Join-Path $env:systemdrive 'tools'
} else {
if ($olderRoot -ne $null) {
if ($binRoot -eq $null) {
$binRoot = $olderRoot
}
Set-EnvironmentVariable -Name "chocolatey_bin_root" -Value '' -Scope User -ErrorAction SilentlyContinue
}
$toolsLocation = $binRoot
Set-EnvironmentVariable -Name "ChocolateyBinRoot" -Value '' -Scope User -ErrorAction SilentlyContinue
}
}
# Add a drive letter if one doesn't exist
if (-not($toolsLocation -imatch "^\w:")) {
$toolsLocation = Join-Path $env:systemdrive $toolsLocation
}
if (-not($env:ChocolateyToolsLocation -eq $toolsLocation)) {
try {
Set-EnvironmentVariable -Name "ChocolateyToolsLocation" -Value $toolsLocation -Scope User
} catch {
if (Test-ProcessAdminRights) {
# sometimes User scope may not exist (such as with core)
Set-EnvironmentVariable -Name "ChocolateyToolsLocation" -Value $toolsLocation -Scope Machine
} else {
throw $_.Exception
}
}
}
return $toolsLocation
}
Set-Alias Get-BinRoot Get-ToolsLocation -Force -Scope Global -Option AllScope
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBs7SY2hT94PeHu
# DDZ8rRekJkr0VcGrRRRJGqRpZeGG9qCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj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GjgafyZnhHEIdslspuY7n28H+3GkwTKGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDI2WjAjBgkqhkiG9w0BCQQxFgQU3essDVMgmu/1Shgu
# ndCmzau++PAwDQYJKoZIhvcNAQEBBQAEggEAHYdKUEMNvVj16S8pU0CzH70Depx/
# dPm3VLBj6oZRaW2uGMaJqFt3O+oRGFTQhoeMmrqfnqFE0PisTRWjJTtc5nDeujsY
# jt4rBl+BC0/yMPcmNEH1uKyxNpw7tWp/X2eEA+YLLveQ4mLcl5D85DiqSV4gO88r
# 3iO0kHgcstSswrTF5vxFE6ticFJNgTj9Vl4MrDom6AkxtD7cD8g4XJ74VVxyAL1o
# k1W2uAdwQ3u7ouIwG52qIIV87y0Nrrx03YmSLVwx+aSM+cBaDijiPl930+VHty2/
# kjOO1fD/blgPrY0SRmaByQ2a5eTdHUT0y4cYVaJRIs5H+oWIsRryuFLOYg==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-UACEnabled {
<#
.SYNOPSIS
Determines if UAC (User Account Control) is turned on or off.
.DESCRIPTION
This is a low level function used by Chocolatey to decide whether
prompting for elevated privileges is necessary or not.
.NOTES
This checks the `EnableLUA` registry value to be determine the state of
a system.
.INPUTS
None
.OUTPUTS
System.Boolean
#>
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$uacRegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
$uacRegValue = "EnableLUA"
$uacEnabled = $false
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
$osVersion = [Environment]::OSVersion.Version
if ($osVersion -ge [Version]'6.0')
{
$uacRegSetting = Get-ItemProperty -Path $uacRegPath
try {
$uacValue = $uacRegSetting.EnableLUA
if ($uacValue -eq 1) {
$uacEnabled = $true
}
} catch {
#regkey doesn't exist, so proceed with false
}
}
return $uacEnabled
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDQqd4yitDMET4w
# wEMYQrhiQG1wsQAhT2QEV1bCR8jY8KCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ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3gka0esX4ojDnbqzpAhRodKQhUgUFheNeKJmA==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2011 - 2017 RealDimensions Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-UninstallRegistryKey {
<#
.SYNOPSIS
Retrieve registry key(s) for system-installed applications from an
exact or wildcard search.
.DESCRIPTION
This function will attempt to retrieve a matching registry key for an
already installed application, usually to be used with a
chocolateyUninstall.ps1 automation script.
The function also prevents `Get-ItemProperty` from failing when
handling wrongly encoded registry keys.
.NOTES
Available in 0.9.10+. If you need to maintain compatibility with pre
0.9.10, please add the following to your nuspec (check for minimum
version):
~~~xml
<dependencies>
<dependency id="chocolatey-core.extension" version="1.1.0" />
</dependencies>
~~~
.INPUTS
String
.OUTPUTS
This function searches registry objects and returns an array
of PSCustomObject with the matched key's properties.
Retrieve properties with dot notation, for example:
`$key.UninstallString`
.PARAMETER SoftwareName
Part or all of the Display Name as you see it in Programs and Features.
It should be enough to be unique.
The syntax follows the rules of the PowerShell `-like` operator, so the
`*` character is interpreted as a wildcard, which matches any (zero or
more) characters.
If the display name contains a version number, such as "Launchy (2.5)",
it is recommended you use a fuzzy search `"Launchy (*)"` (the wildcard
`*`) so if Launchy auto-updates or is updated outside of Chocolatey, the
uninstall script will not fail.
Take care not to abuse fuzzy/glob pattern searches. Be conscious of
programs that may have shared or common root words to prevent
overmatching. For example, "SketchUp*" would match two keys with
software names "SketchUp 2016" and "SketchUp Viewer" that are different
programs released by the same company.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
# Version match: Software name is "Gpg4Win (2.3.0)"
[array]$key = Get-UninstallRegistryKey -SoftwareName "Gpg4win (*)"
$key.UninstallString
.EXAMPLE
>
# Fuzzy match: Software name is "Launchy 2.5"
[array]$key = Get-UninstallRegistryKey -SoftwareName "Launchy*"
$key.UninstallString
.EXAMPLE
>
# Exact match: Software name in Programs and Features is "VLC media player"
[array]$key = Get-UninstallRegistryKey -SoftwareName "VLC media player"
$key.UninstallString
.EXAMPLE
>
# Version match: Software name is "SketchUp 2016"
# Note that the similar software name "SketchUp Viewer" would not be matched.
[array]$key = Get-UninstallRegistryKey -SoftwareName "SketchUp [0-9]*"
$key.UninstallString
.LINK
Install-ChocolateyPackage
.LINK
Install-ChocolateyInstallPackage
.LINK
Uninstall-ChocolateyPackage
#>
[CmdletBinding()]
param(
[parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)]
[string] $softwareName,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if ($softwareName -eq $null -or $softwareName -eq '') {
throw "$SoftwareName cannot be empty for Get-UninstallRegistryKey"
}
$ErrorActionPreference = 'Stop'
$local_key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
$machine_key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
$machine_key6432 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
Write-Verbose "Retrieving all uninstall registry keys"
[array]$keys = Get-ChildItem -Path @($machine_key6432, $machine_key, $local_key) -ErrorAction SilentlyContinue
Write-Debug "Registry uninstall keys on system: $($keys.Count)"
Write-Debug "Error handling check: `'Get-ItemProperty`' fails if a registry key is encoded incorrectly."
[int]$maxAttempts = $keys.Count
for ([int]$attempt = 1; $attempt -le $maxAttempts; $attempt++) {
[bool]$success = $false
$keyPaths = $keys | Select-Object -ExpandProperty PSPath
try {
[array]$foundKey = Get-ItemProperty -Path $keyPaths -ErrorAction Stop | ? { $_.DisplayName -like $softwareName }
$success = $true
} catch {
Write-Debug "Found bad key."
foreach ($key in $keys){
try {
Get-ItemProperty $key.PsPath > $null
} catch {
$badKey = $key.PsPath
}
}
Write-Verbose "Skipping bad key: $badKey"
[array]$keys = $keys | ? { $badKey -NotContains $_.PsPath }
}
if ($success) { break; }
if ($attempt -ge 10) {
Write-Warning "Found 10 or more bad registry keys. Run command again with `'--verbose --debug`' for more info."
Write-Debug "Each key searched should correspond to an installed program. It is very unlikely to have more than a few programs with incorrectly encoded keys, if any at all. This may be indicative of one or more corrupted registry branches."
}
}
if ($foundKey -eq $null -or $foundkey.Count -eq 0) {
Write-Warning "No registry key found based on '$softwareName'"
}
Write-Debug "Found $($foundKey.Count) uninstall registry key(s) with SoftwareName:`'$SoftwareName`'";
return $foundKey
}
Set-Alias Get-InstallRegistryKey Get-UninstallRegistryKey
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBES8sHzbRLLNcJ
# 9iSdROLrD1zFWyfa5gBGwaNn1wzd16CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xM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yright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-VirusCheckValid {
<#
.SYNOPSIS
Used in Pro/Business editions. Runtime virus check against downloaded
resources.
.DESCRIPTION
Run a runtime malware check against downloaded resources prior to
allowing Chocolatey to execute a file. This is available in 0.9.10+ only
in Pro / Business editions.
.NOTES
Only licensed editions of Chocolatey provide runtime malware protection.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Url
Not used
.PARAMETER File
The full file path to the file to verify against anti-virus scanners.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
#>
param(
[parameter(Mandatory=$false, Position=0)][string] $url,
[parameter(Mandatory=$false, Position=1)][string] $file = '',
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-Debug "No runtime virus checking built into FOSS Chocolatey. Check out Pro/Business - https://chocolatey.org/compare"
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCdXHW+nvROXlyk
# 0VpqIg0k2DsReyeCNeGyxdwEeYS2DqCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYT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AnMvBqaXfEY
# rR1bXdcM757SziinYA9My+/Kjx5fF0sHyq8a7VLCtBS5lBcW/dN726zuRR9gW5xl
# nunaeQUqztPvkvRYcONVofkNeEHGeSZWT3MgoxDnPonhxidHmk6qlpcEmFr8Qka3
# DF6Ij6lFdpuj9gHhzr2HtoPfqB/yRUm9Jag+3AZoP0SrHuaNii+KrOzQ0p903R67
# gv0h7pcWjMeXGRdB/Xd6dqDG61ymra1CJPBqtye4YrGAM/dS4NHouuWvNQ==
# SIG # End signature block
# http://poshcode.org/417
## Get-WebFile (aka wget for PowerShell)
##############################################################################################################
## Downloads a file or page from the web
## History:
## v3.6 - Add -Passthru switch to output TEXT files
## v3.5 - Add -Quiet switch to turn off the progress reports ...
## v3.4 - Add progress report for files which don't report size
## v3.3 - Add progress report for files which report their size
## v3.2 - Use the pure Stream object because StreamWriter is based on TextWriter:
## it was messing up binary files, and making mistakes with extended characters in text
## v3.1 - Unwrap the filename when it has quotes around it
## v3 - rewritten completely using HttpWebRequest + HttpWebResponse to figure out the file name, if possible
## v2 - adds a ton of parsing to make the output pretty
## added measuring the scripts involved in the command, (uses Tokenizer)
##############################################################################################################
## Additional functionality added by Chocolatey Team / Chocolatey Contributors
## - Proxy
## - Better error handling
## - Inline documentation
## - Cmdlet conversion
## - Closing request/response and cleanup
## - Request / ReadWriteResponse Timeouts
##############################################################################################################
function Get-WebFile {
<#
.SYNOPSIS
Downloads a file from an HTTP/HTTPS location. Prefer HTTPS when
available.
.DESCRIPTION
This will download a file from an HTTP/HTTPS location, saving the file
to the FileName location specified.
.NOTES
This is a low-level function and not recommended for use in package
scripts. It is recommended you call `Get-ChocolateyWebFile` instead.
Starting in 0.9.10, will automatically call Set-PowerShellExitCode to
set the package exit code to 404 if the resource is not found.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Url
This is the url to download the file from. Prefer HTTPS when available.
.PARAMETER FileName
This is the full path to the file to create. If downloading to the
package folder next to the install script, the path will be like
`"$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\\file.exe"`
.PARAMETER UserAgent
The user agent to use as part of the request. Defaults to 'chocolatey
command line'.
.PARAMETER PassThru
DO NOT USE - holdover from original function.
.PARAMETER Quiet
Silences the progress output.
.PARAMETER Options
OPTIONAL - Specify custom headers. Available in 0.9.10+.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.LINK
Get-ChocolateyWebFile
.LINK
Get-FtpFile
.LINK
Get-WebHeaders
.LINK
Get-WebFileName
#>
param(
[parameter(Mandatory=$false, Position=0)][string] $url = '', #(Read-Host "The URL to download"),
[parameter(Mandatory=$false, Position=1)][string] $fileName = $null,
[parameter(Mandatory=$false, Position=2)][string] $userAgent = 'chocolatey command line',
[parameter(Mandatory=$false)][switch] $Passthru,
[parameter(Mandatory=$false)][switch] $quiet,
[parameter(Mandatory=$false)][hashtable] $options = @{Headers=@{}},
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
try {
$uri = [System.Uri]$url
if ($uri.IsFile()) {
Write-Debug "Url is local file, setting destination"
if ($url.LocalPath -ne $fileName) {
Copy-Item $uri.LocalPath -Destination $fileName -Force
}
return
}
} catch {
#continue on
}
$req = [System.Net.HttpWebRequest]::Create($url);
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials
if ($defaultCreds -ne $null) {
$req.Credentials = $defaultCreds
}
$webclient = new-object System.Net.WebClient
if ($defaultCreds -ne $null) {
$webClient.Credentials = $defaultCreds
}
# check if a proxy is required
$explicitProxy = $env:chocolateyProxyLocation
$explicitProxyUser = $env:chocolateyProxyUser
$explicitProxyPassword = $env:chocolateyProxyPassword
$explicitProxyBypassList = $env:chocolateyProxyBypassList
$explicitProxyBypassOnLocal = $env:chocolateyProxyBypassOnLocal
if ($explicitProxy -ne $null) {
# explicit proxy
$proxy = New-Object System.Net.WebProxy($explicitProxy, $true)
if ($explicitProxyPassword -ne $null) {
$passwd = ConvertTo-SecureString $explicitProxyPassword -AsPlainText -Force
$proxy.Credentials = New-Object System.Management.Automation.PSCredential ($explicitProxyUser, $passwd)
}
if ($explicitProxyBypassList -ne $null -and $explicitProxyBypassList -ne '') {
$proxy.BypassList = $explicitProxyBypassList.Split(',', [System.StringSplitOptions]::RemoveEmptyEntries)
}
if ($explicitProxyBypassOnLocal -eq 'true') { $proxy.BypassProxyOnLocal = $true; }
Write-Host "Using explicit proxy server '$explicitProxy'."
$req.Proxy = $proxy
} elseif ($webclient.Proxy -and !$webclient.Proxy.IsBypassed($url)) {
# system proxy (pass through)
$creds = [net.CredentialCache]::DefaultCredentials
if ($creds -eq $null) {
Write-Debug "Default credentials were null. Attempting backup method"
$cred = get-credential
$creds = $cred.GetNetworkCredential();
}
$proxyaddress = $webclient.Proxy.GetProxy($url).Authority
Write-Host "Using system proxy server '$proxyaddress'."
$proxy = New-Object System.Net.WebProxy($proxyaddress)
$proxy.Credentials = $creds
$proxy.BypassProxyOnLocal = $true
$req.Proxy = $proxy
}
$req.Accept = "*/*"
$req.AllowAutoRedirect = $true
$req.MaximumAutomaticRedirections = 20
#$req.KeepAlive = $true
$req.AutomaticDecompression = [System.Net.DecompressionMethods]::GZip -bor [System.Net.DecompressionMethods]::Deflate
$req.Timeout = 30000
if ($env:chocolateyRequestTimeout -ne $null -and $env:chocolateyRequestTimeout -ne '') {
Write-Debug "Setting request timeout to $env:chocolateyRequestTimeout"
$req.Timeout = $env:chocolateyRequestTimeout
}
if ($env:chocolateyResponseTimeout -ne $null -and $env:chocolateyResponseTimeout -ne '') {
Write-Debug "Setting read/write timeout to $env:chocolateyResponseTimeout"
$req.ReadWriteTimeout = $env:chocolateyResponseTimeout
}
#http://stackoverflow.com/questions/518181/too-many-automatic-redirections-were-attempted-error-message-when-using-a-httpw
$req.CookieContainer = New-Object System.Net.CookieContainer
if ($userAgent -ne $null) {
Write-Debug "Setting the UserAgent to `'$userAgent`'"
$req.UserAgent = $userAgent
}
if ($options.Headers.Count -gt 0) {
Write-Debug "Setting custom headers"
foreach ($item in $options.Headers.GetEnumerator()) {
$uri = (new-object system.uri $url)
Write-Debug($item.Key + ':' + $item.Value)
switch ($item.Key) {
'Accept' {$req.Accept = $item.Value}
'Cookie' {$req.CookieContainer.SetCookies($uri, $item.Value)}
'Referer' {$req.Referer = $item.Value}
'User-Agent' {$req.UserAgent = $item.Value}
Default {$req.Headers.Add($item.Key, $item.Value)}
}
}
}
try {
$res = $req.GetResponse();
try {
$headers = @{}
foreach ($key in $res.Headers) {
$value = $res.Headers[$key];
if ($value) {
$headers.Add("$key","$value")
}
}
$binaryIsTextCheckFile = "$fileName.istext"
if (Test-Path($binaryIsTextCheckFile)) { Remove-Item $binaryIsTextCheckFile -Force -EA SilentlyContinue; }
if ($headers.ContainsKey("Content-Type")) {
$contentType = $headers['Content-Type']
if ($contentType -ne $null) {
if ($contentType.ToLower().Contains("text/html") -or $contentType.ToLower().Contains("text/plain")) {
Write-Warning "$fileName is of content type $contentType"
Set-Content -Path $binaryIsTextCheckFile -Value "$fileName has content type $contentType" -Encoding UTF8 -Force
}
}
}
} catch {
# not able to get content-type header
Write-Debug "Error getting content type - $($_.Exception.Message)"
}
if($fileName -and !(Split-Path $fileName)) {
$fileName = Join-Path (Get-Location -PSProvider "FileSystem") $fileName
}
elseif((!$Passthru -and ($fileName -eq $null)) -or (($fileName -ne $null) -and (Test-Path -PathType "Container" $fileName)))
{
[string]$fileName = ([regex]'(?i)filename=(.*)$').Match( $res.Headers["Content-Disposition"] ).Groups[1].Value
$fileName = $fileName.trim("\/""'")
if(!$fileName) {
$fileName = $res.ResponseUri.Segments[-1]
$fileName = $fileName.trim("\/")
if(!$fileName) {
$fileName = Read-Host "Please provide a file name"
}
$fileName = $fileName.trim("\/")
if(!([IO.FileInfo]$fileName).Extension) {
$fileName = $fileName + "." + $res.ContentType.Split(";")[0].Split("/")[1]
}
}
$fileName = Join-Path (Get-Location -PSProvider "FileSystem") $fileName
}
if($Passthru) {
$encoding = [System.Text.Encoding]::GetEncoding( $res.CharacterSet )
[string]$output = ""
}
if($res.StatusCode -eq 401 -or $res.StatusCode -eq 403 -or $res.StatusCode -eq 404) {
$env:ChocolateyExitCode = $res.StatusCode
throw "Remote file either doesn't exist, is unauthorized, or is forbidden for '$url'."
}
if($res.StatusCode -eq 200) {
[long]$goal = $res.ContentLength
$goalFormatted = Format-FileSize $goal
$reader = $res.GetResponseStream()
if ($fileName) {
$fileDirectory = $([System.IO.Path]::GetDirectoryName($fileName))
if (!(Test-Path($fileDirectory))) {
[System.IO.Directory]::CreateDirectory($fileDirectory) | Out-Null
}
try {
$writer = new-object System.IO.FileStream $fileName, "Create"
} catch {
throw $_.Exception
}
}
[byte[]]$buffer = new-object byte[] 1048576
[long]$total = [long]$count = [long]$iterLoop =0
$originalEAP = $ErrorActionPreference
$ErrorActionPreference = 'Stop'
try {
do
{
$count = $reader.Read($buffer, 0, $buffer.Length);
if($fileName) {
$writer.Write($buffer, 0, $count);
}
if($Passthru){
$output += $encoding.GetString($buffer,0,$count)
} elseif(!$quiet) {
$total += $count
$totalFormatted = Format-FileSize $total
if($goal -gt 0 -and ++$iterLoop%10 -eq 0) {
$percentComplete = [Math]::Truncate(($total/$goal)*100)
Write-Progress "Downloading $url to $fileName" "Saving $totalFormatted of $goalFormatted" -id 0 -percentComplete $percentComplete
}
if ($total -eq $goal -and $count -eq 0) {
Write-Progress "Completed download of $url." "Completed download of $fileName ($goalFormatted)." -id 0 -Completed -PercentComplete 100
}
}
} while ($count -gt 0)
Write-Host ""
Write-Host "Download of $([System.IO.Path]::GetFileName($fileName)) ($goalFormatted) completed."
} catch {
throw $_.Exception
} finally {
$ErrorActionPreference = $originalEAP
}
$reader.Close()
if($fileName) {
$writer.Flush()
$writer.Close()
}
if($Passthru){
$output
}
}
} catch {
if ($req -ne $null) {
$req.ServicePoint.MaxIdleTime = 0
$req.Abort();
# ruthlessly remove $req to ensure it isn't reused
Remove-Variable req
Start-Sleep 1
[GC]::Collect()
}
Set-PowerShellExitCode 404
if ($env:DownloadCacheAvailable -eq 'true') {
throw "The remote file either doesn't exist, is unauthorized, or is forbidden for url '$url'. $($_.Exception.Message) `nThis package is likely not broken for licensed users - see https://chocolatey.org/docs/features-private-cdn."
} else {
throw "The remote file either doesn't exist, is unauthorized, or is forbidden for url '$url'. $($_.Exception.Message)"
}
} finally {
if ($res -ne $null) {
$res.Close()
}
Start-Sleep 1
}
}
# this could be cleaned up with http://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDvexJR6JVsFWB6
# VwL5cCsMqeQkBR2xfN1oHBm2m1/Et6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2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H/skCLTwzfh2BYBGB+3QTJoD8MCpGIm0L1BsYbNLYshqKsWRgb+0INVUrWjMVFT+
# fA0IhrHncrMLGVu3RaSYSptlbomhwZa97XXlbfHgTmm4qMg8eHv9tqGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDI3WjAjBgkqhkiG9w0BCQQxFgQU74Jkp0Yn9qrZKJT4
# 1QSAoyCyL+owDQYJKoZIhvcNAQEBBQAEggEAWWhOjS8dntseyZNhll1hngoaCxfK
# LFW94L8Xm45ZEXjmRTejgADVrwjlInshO5wSxKbGdRdantvPudAV2wW6Sqy4Nrgl
# xm4vxx0az8RZfIa4KsInrZph1HUff80Nw+VqjzciaygwKRUZmJu0VdB/7e6SVU5j
# GyCAhr8EHFSHWSBfFxLXmrCRWvskabeaQyHJ8bzAp7XVZV4DPjLDLyTIKORiwd+m
# ovlbyBAmWtaEBQrKS9+c7du/RoFJg8ToKq1hoJclF8sDqLsK2lMCzWZovrtK8dKK
# 6we4bh2+JuABRmQT++VDHSVxB+09ZemE+XDB6X/dTR3l70dDWQK5U1ndiA==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2011 - 2017 RealDimensions Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Based on http://stackoverflow.com/a/13571471/18475
function Get-WebFileName {
<#
.SYNOPSIS
Gets the original file name from a url. Used by Get-WebFile to determine
the original file name for a file.
.DESCRIPTION
Uses several techniques to determine the original file name of the file
based on the url for the file.
.NOTES
Available in 0.9.10+.
Falls back to DefaultName when the name cannot be determined.
Chocolatey works best when the packages contain the software it is
managing and doesn't require downloads. However most software in the
Windows world requires redistribution rights and when sharing packages
publicly (like on the community feed), maintainers may not have those
aforementioned rights. Chocolatey understands how to work with that,
hence this function. You are not subject to this limitation with
internal packages.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Url
This is the url to a file that will be possibly downloaded.
.PARAMETER DefaultName
The name of the file to use when not able to determine the file name
from the url response.
.PARAMETER UserAgent
The user agent to use as part of the request. Defaults to 'chocolatey
command line'.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Get-WebFileName -Url $url -DefaultName $originalFileName
.LINK
Get-WebHeaders
.LINK
Get-ChocolateyWebFile
#>
param(
[parameter(Mandatory=$false, Position=0)][string] $url = '',
[parameter(Mandatory=$true, Position=1)][string] $defaultName,
[parameter(Mandatory=$false)][string] $userAgent = 'chocolatey command line',
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$originalFileName = $defaultName
$fileName = $null
if ($url -eq $null -or $url -eq '') {
Write-Debug "Url was null, using default name."
return $originalFileName
}
try {
$uri = [System.Uri]$url
if ($uri.IsFile()) {
$fileName = [System.IO.Path]::GetFileName($uri.LocalPath)
Write-Debug "Url is local file, returning fileName"
return $fileName
}
} catch {
#continue on
}
if ($url.StartsWith('ftp')) {
Write-Debug "Url is FTP, using default name."
return $originalFileName
}
$request = [System.Net.HttpWebRequest]::Create($url)
if ($request -eq $null) {
Write-Debug "Request was null, using default name."
return $originalFileName
}
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials
if ($defaultCreds -ne $null) {
$request.Credentials = $defaultCreds
}
$client = New-Object System.Net.WebClient
if ($defaultCreds -ne $null) {
$client.Credentials = $defaultCreds
}
# check if a proxy is required
$explicitProxy = $env:chocolateyProxyLocation
$explicitProxyUser = $env:chocolateyProxyUser
$explicitProxyPassword = $env:chocolateyProxyPassword
$explicitProxyBypassList = $env:chocolateyProxyBypassList
$explicitProxyBypassOnLocal = $env:chocolateyProxyBypassOnLocal
if ($explicitProxy -ne $null) {
# explicit proxy
$proxy = New-Object System.Net.WebProxy($explicitProxy, $true)
if ($explicitProxyPassword -ne $null) {
$passwd = ConvertTo-SecureString $explicitProxyPassword -AsPlainText -Force
$proxy.Credentials = New-Object System.Management.Automation.PSCredential ($explicitProxyUser, $passwd)
}
if ($explicitProxyBypassList -ne $null -and $explicitProxyBypassList -ne '') {
$proxy.BypassList = $explicitProxyBypassList.Split(',', [System.StringSplitOptions]::RemoveEmptyEntries)
}
if ($explicitProxyBypassOnLocal -eq 'true') { $proxy.BypassProxyOnLocal = $true; }
Write-Debug "Using explicit proxy server '$explicitProxy'."
$request.Proxy = $proxy
} elseif ($client.Proxy -and !$client.Proxy.IsBypassed($url)) {
# system proxy (pass through)
$creds = [Net.CredentialCache]::DefaultCredentials
if ($creds -eq $null) {
Write-Debug "Default credentials were null. Attempting backup method"
$cred = Get-Credential
$creds = $cred.GetNetworkCredential();
}
$proxyAddress = $client.Proxy.GetProxy($url).Authority
Write-Debug "Using system proxy server '$proxyaddress'."
$proxy = New-Object System.Net.WebProxy($proxyAddress)
$proxy.Credentials = $creds
$proxy.BypassProxyOnLocal = $true
$request.Proxy = $proxy
}
$request.Method = "GET"
$request.Accept = '*/*'
$request.AllowAutoRedirect = $true
$request.MaximumAutomaticRedirections = 20
#$request.KeepAlive = $true
$request.AutomaticDecompression = [System.Net.DecompressionMethods]::GZip -bor [System.Net.DecompressionMethods]::Deflate
$request.Timeout = 30000
if ($env:chocolateyRequestTimeout -ne $null -and $env:chocolateyRequestTimeout -ne '') {
$request.Timeout = $env:chocolateyRequestTimeout
}
if ($env:chocolateyResponseTimeout -ne $null -and $env:chocolateyResponseTimeout -ne '') {
$request.ReadWriteTimeout = $env:chocolateyResponseTimeout
}
#http://stackoverflow.com/questions/518181/too-many-automatic-redirections-were-attempted-error-message-when-using-a-httpw
$request.CookieContainer = New-Object System.Net.CookieContainer
$request.UserAgent = $userAgent
[System.Text.RegularExpressions.Regex]$containsABadCharacter = New-Object Regex("[" + [System.Text.RegularExpressions.Regex]::Escape([System.IO.Path]::GetInvalidFileNameChars() -join '') + "\=\;]");
try
{
[System.Net.HttpWebResponse]$response = $request.GetResponse()
if ($response -eq $null) {
Write-Debug "Response was null, using default name."
return $originalFileName
}
[string]$header = $response.Headers['Content-Disposition']
[string]$headerLocation = $response.Headers['Location']
# start with content-disposition header
if ($header -ne '') {
$fileHeaderName = 'filename='
$index = $header.LastIndexOf($fileHeaderName, [StringComparison]::OrdinalIgnoreCase)
if ($index -gt -1) {
Write-Debug "Using header 'Content-Disposition' to determine file name."
$fileName = $header.Substring($index + $fileHeaderName.Length).Replace('"', '')
}
}
if ($containsABadCharacter.IsMatch($fileName)) { $fileName = $null }
# If empty, check location header next
if ($fileName -eq $null -or $fileName -eq '') {
if ($headerLocation -ne '') {
Write-Debug "Using header 'Location' to determine file name."
$fileName = [System.IO.Path]::GetFileName($headerLocation)
}
}
if ($containsABadCharacter.IsMatch($fileName)) { $fileName = $null }
# Next comes using the response url value
if ($fileName -eq $null -or $fileName -eq '') {
$responseUrl = $response.ResponseUri.ToString()
if (!$responseUrl.Contains('?')) {
Write-Debug "Using response url to determine file name. '$responseUrl'"
$fileName = [System.IO.Path]::GetFileName($responseUrl)
}
}
if ($containsABadCharacter.IsMatch($fileName)) { $fileName = $null }
# Next comes using the request url value
if ($fileName -eq $null -or $fileName -eq '') {
$requestUrl = $url
$extension = [System.IO.Path]::GetExtension($requestUrl)
if (!$requestUrl.Contains('?') -and $extension -ne $null -and $extension -ne '') {
Write-Debug "Using request url to determine file name. ' $requestUrl'"
$fileName = [System.IO.Path]::GetFileName($requestUrl)
}
}
# when all else fails, default the name
if ($fileName -eq $null -or $fileName -eq '' -or $containsABadCharacter.IsMatch($fileName)) {
Write-Debug "File name is null or illegal. Using $originalFileName instead."
$fileName = $originalFileName
}
Write-Debug "File name determined from url is '$fileName'"
return $fileName
} catch {
if ($request -ne $null) {
$request.ServicePoint.MaxIdleTime = 0
$request.Abort();
# ruthlessly remove $request to ensure it isn't reused
Remove-Variable request
Start-Sleep 1
[GC]::Collect()
}
Write-Debug "Url request/response failed - file name will be '$originalFileName': $($_)"
return $originalFileName
} finally {
if ($response -ne $null) {
$response.Close();
}
}
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDiDKT4Ivu6Jqnw
# BS5U06cRve0/mwOoi7OjAuGwTp3bXaCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ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ealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Get-WebHeaders {
<#
.SYNOPSIS
Gets the request/response headers for a url.
.DESCRIPTION
This is a low-level function that is used by Chocolatey to get the
headers for a request/response to better help when getting and
validating internet resources.
.NOTES
Not recommended for use in package scripts.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Url
This is the url to get a request/response from.
.PARAMETER UserAgent
The user agent to use as part of the request. Defaults to 'chocolatey
command line'.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.LINK
Get-ChocolateyWebFile
.LINK
Get-WebFileName
.LINK
Get-WebFile
#>
param(
[parameter(Mandatory=$false, Position=0)][string] $url = '',
[parameter(Mandatory=$false, Position=1)][string] $userAgent = 'chocolatey command line',
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if ($url -eq '') { return @{} }
$request = [System.Net.HttpWebRequest]::Create($url);
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials
if ($defaultCreds -ne $null) {
$request.Credentials = $defaultCreds
}
#$request.Method = "HEAD"
$client = New-Object System.Net.WebClient
if ($defaultCreds -ne $null) {
$client.Credentials = $defaultCreds
}
# check if a proxy is required
$explicitProxy = $env:chocolateyProxyLocation
$explicitProxyUser = $env:chocolateyProxyUser
$explicitProxyPassword = $env:chocolateyProxyPassword
$explicitProxyBypassList = $env:chocolateyProxyBypassList
$explicitProxyBypassOnLocal = $env:chocolateyProxyBypassOnLocal
if ($explicitProxy -ne $null) {
# explicit proxy
$proxy = New-Object System.Net.WebProxy($explicitProxy, $true)
if ($explicitProxyPassword -ne $null) {
$passwd = ConvertTo-SecureString $explicitProxyPassword -AsPlainText -Force
$proxy.Credentials = New-Object System.Management.Automation.PSCredential ($explicitProxyUser, $passwd)
}
if ($explicitProxyBypassList -ne $null -and $explicitProxyBypassList -ne '') {
$proxy.BypassList = $explicitProxyBypassList.Split(',', [System.StringSplitOptions]::RemoveEmptyEntries)
}
if ($explicitProxyBypassOnLocal -eq 'true') { $proxy.BypassProxyOnLocal = $true; }
Write-Host "Using explicit proxy server '$explicitProxy'."
$request.Proxy = $proxy
} elseif ($client.Proxy -and !$client.Proxy.IsBypassed($url)) {
# system proxy (pass through)
$creds = [Net.CredentialCache]::DefaultCredentials
if ($creds -eq $null) {
Write-Debug "Default credentials were null. Attempting backup method"
$cred = Get-Credential
$creds = $cred.GetNetworkCredential();
}
$proxyAddress = $client.Proxy.GetProxy($url).Authority
Write-Host "Using system proxy server '$proxyaddress'."
$proxy = New-Object System.Net.WebProxy($proxyAddress)
$proxy.Credentials = $creds
$proxy.BypassProxyOnLocal = $true
$request.Proxy = $proxy
}
$request.Accept = '*/*'
$request.AllowAutoRedirect = $true
$request.MaximumAutomaticRedirections = 20
#$request.KeepAlive = $true
$request.AutomaticDecompression = [System.Net.DecompressionMethods]::GZip -bor [System.Net.DecompressionMethods]::Deflate
$request.Timeout = 30000
if ($env:chocolateyRequestTimeout -ne $null -and $env:chocolateyRequestTimeout -ne '') {
$request.Timeout = $env:chocolateyRequestTimeout
}
if ($env:chocolateyResponseTimeout -ne $null -and $env:chocolateyResponseTimeout -ne '') {
$request.ReadWriteTimeout = $env:chocolateyResponseTimeout
}
#http://stackoverflow.com/questions/518181/too-many-automatic-redirections-were-attempted-error-message-when-using-a-httpw
$request.CookieContainer = New-Object System.Net.CookieContainer
if ($userAgent -ne $null) {
Write-Debug "Setting the UserAgent to `'$userAgent`'"
$request.UserAgent = $userAgent
}
Write-Debug "Request Headers:"
foreach ($key in $request.Headers) {
$value = $request.Headers[$key];
if ($value) {
Write-Debug " `'$key`':`'$value`'"
} else {
Write-Debug " `'$key`'"
}
}
$headers = @{}
try {
$response = $request.GetResponse();
Write-Debug "Response Headers:"
foreach ($key in $response.Headers) {
$value = $response.Headers[$key];
if ($value) {
$headers.Add("$key","$value")
Write-Debug " `'$key`':`'$value`'"
}
}
} catch {
if ($request -ne $null) {
$request.ServicePoint.MaxIdleTime = 0
$request.Abort();
# ruthlessly remove $request to ensure it isn't reused
Remove-Variable request
Start-Sleep 1
[GC]::Collect()
}
throw "The remote file either doesn't exist, is unauthorized, or is forbidden for url '$url'. $($_.Exception.Message)"
} finally {
if ($response -ne $null) {
$response.Close();
}
}
$headers
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBIywVeApHFkthX
# +TXpq4Asse9ZcA9oI9e/kuBh/2BhoaCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25p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4MA
# HY+GKbrIoHfD317FGysaEGqsE7VUhh4bgKvjFY0IWWCeRwj/FRKRuHFgDKqyUs/g
# E3uIt9XpeUSbCZd3r4BArvcTYtILE1OjnMh2D11kIRA/xnTumrdxNXNPHBG5hFn+
# OTF0RJDuWVAzk9goAyHM/tAZn7vUWU0udLcFpnrkjnhF2WfQ5nAby8nFWtLxeL78
# 94hAZC2q+sS8lp8f5dEgETwPJhbL2SBGbl6GLsHVbCqrjK55ijlp8aGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDI4WjAjBgkqhkiG9w0BCQQxFgQUU1wtQDlmxqcEPT7X
# XGW5OJOKhaUwDQYJKoZIhvcNAQEBBQAEggEAF7YTB6uerWBdg2Yx3746R0OaRa73
# Xtirn9OGXOLSZYxi3I+IChTPf2outO/iRUJ2aBBS76hqHfaH2E4N1oDPWEYyIftL
# w+uFxuxUrkN4IfwNUAjcCIYicy4+sb+wQkwRF9ROilCuBO+dvNQ4qzU5hsoKyHBN
# 7WTMgLQ6N0AnEHqonto7s+mbPybeCvPEtNg/ZOTr8xdR94g+7GKGgFBWoxNtOOdr
# 9kMo2TdkOtYlGOGXFTgdc6i0y5n+uwDjGTmvHInA5tjt89wWS1++81QkK22OTq9f
# jLTsftVhlEvGjs7XKZqdFxgT+kvbC+DBGHf1zIy3ZF7SFWpa6C0dkKx7cw==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-BinFile {
<#
.SYNOPSIS
Creates a shim (or batch redirect) for a file that is on the PATH.
.DESCRIPTION
Chocolatey installs have the folder `$($env:ChocolateyInstall)\bin`
included in the PATH environment variable. Chocolatey automatically
shims executables in package folders that are not explicitly ignored,
putting them into the bin folder (and subsequently onto the PATH).
When you have other files you want to shim to add them to the PATH or
if you want to handle the shimming explicitly, use this function.
If you do use this function, ensure you also add `Uninstall-BinFile` to
your `chocolateyUninstall.ps1` script as Chocolatey will not
automatically clean up shims created with this function.
.NOTES
Not normally needed for exe files in the package folder, those are
automatically discovered and added as shims after the install script
completes.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Name
The name of the redirect file, will have .exe appended to it.
.PARAMETER Path
The path to the original file. Can be relative from
`$($env:ChocolateyInstall)\bin` back to your file or a full path to the
file.
.PARAMETER UseStart
This should be passed if the shim should not wait on the action to
complete. This is usually the case with GUI apps, you don't want the
command shell blocked waiting for the GUI app to be shut back down.
.PARAMETER Command
OPTIONAL - This is any additional command arguments you want passed
every time to the command. This is not normally used, but may be
necessary if you are calling something and then your application. For
example if you are calling Java with your JAR, the command would be the
JAR file plus any other options to start Java appropriately.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.LINK
Uninstall-BinFile
.LINK
Install-ChocolateyShortcut
.LINK
Install-ChocolateyPath
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $name,
[parameter(Mandatory=$true, Position=1)][string] $path,
[parameter(Mandatory=$false)]
[alias("isGui")][switch] $useStart,
[parameter(Mandatory=$false)][string] $command = '',
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$nugetPath = [System.IO.Path]::GetFullPath((Join-Path "$helpersPath" '..\'))
$nugetExePath = Join-Path "$nugetPath" 'bin'
$packageBatchFileName = Join-Path $nugetExePath "$name.bat"
$packageBashFileName = Join-Path $nugetExePath "$name"
$packageShimFileName = Join-Path $nugetExePath "$name.exe"
if (Test-Path ($packageBatchFileName)) {Remove-Item $packageBatchFileName -force}
if (Test-Path ($packageBashFileName)) {Remove-Item $packageBashFileName -force}
$originalPath = $path
$path = $path.ToLower().Replace($nugetPath.ToLower(), "..\").Replace("\\","\")
$ShimGenArgs = "-o `"$packageShimFileName`" -p `"$path`" -i `"$originalPath`""
if ($command -ne $null -and $command -ne '') {
$ShimGenArgs +=" -c $command"
}
if ($useStart) {
$ShimGenArgs +=" -gui"
}
if ($debug) {
$ShimGenArgs +=" -debug"
}
$ShimGen = Join-Path "$helpersPath" '..\tools\shimgen.exe'
if (!([System.IO.File]::Exists($ShimGen))) {
Update-SessionEnvironment
$ShimGen = Join-Path "$env:ChocolateyInstall" 'tools\shimgen.exe'
}
$ShimGen = [System.IO.Path]::GetFullPath($ShimGen)
Write-Debug "ShimGen found at `'$ShimGen`'"
Write-Debug "Calling $ShimGen $ShimGenArgs"
if (Test-Path ("$ShimGen")) {
#Start-Process "$ShimGen" -ArgumentList "$ShimGenArgs" -Wait -WindowStyle Hidden
$process = New-Object System.Diagnostics.Process
$process.StartInfo = new-object System.Diagnostics.ProcessStartInfo($ShimGen, $ShimGenArgs)
$process.StartInfo.RedirectStandardOutput = $true
$process.StartInfo.RedirectStandardError = $true
$process.StartInfo.UseShellExecute = $false
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
$process.Start() | Out-Null
$process.WaitForExit()
}
if (Test-Path ($packageShimFileName)) {
Write-Host "Added $packageShimFileName shim pointed to `'$path`'."
} else {
Write-Warning "An error occurred generating shim, using old method."
$path = "%DIR%$($path)"
$pathBash = $path.Replace("%DIR%..\","`$DIR/../").Replace("\","/")
Write-Host "Adding $packageBatchFileName and pointing to `'$path`'."
Write-Host "Adding $packageBashFileName and pointing to `'$path`'."
if ($useStart) {
Write-Host "Setting up $name as a non-command line application."
"@echo off
SET DIR=%~dp0%
start """" ""$path"" %*" | Out-File $packageBatchFileName -encoding ASCII
$sw = New-Object IO.StreamWriter "$packageBashFileName"
$sw.Write("#!/bin/sh`nDIR=`${0%/*}`n""$pathBash"" ""`$@"" &`n")
$sw.Close()
$sw.Dispose()
} else {
"@echo off
SET DIR=%~dp0%
cmd /c """"$path"" %*""
exit /b %ERRORLEVEL%" | Out-File $packageBatchFileName -encoding ASCII
$sw = New-Object IO.StreamWriter "$packageBashFileName"
$sw.Write("#!/bin/sh`nDIR=`${0%/*}`n""$pathBash"" ""`$@""`nexit `$?`n")
$sw.Close()
$sw.Dispose()
}
}
}
Set-Alias Generate-BinFile Install-BinFile
Set-Alias Add-BinFile Install-BinFile
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC+O4Rd4fwC+olt
# 41cYf4wWypG8571my8EuMKdXlH9hyaCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw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f4Uf1Ur5Zpu7vqbd7t7n/3NER08B2mTxKk+tc
# 1l8c5Hvv8sY3YCZzbyqUzZ7k8WNmjPi1fWqf1TTxo/MjlI3/oiRwL5xgsQ==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-ChocolateyDesktopLink {
<#
.SYNOPSIS
DEPRECATED - This adds a shortcut on the desktop to the specified file path.
.DESCRIPTION
Determines the desktop folder and creates a shortcut to the specified
file path. Will not throw errors if it fails.
It is recommended you use `Install-ChocolateyShorctut` instead of this
method as this has been deprecated.
.NOTES
Deprecated in favor of [[`Install-ChocolateyShortcut`|HelpersInstallChocolateyShortcut]].
If this errors, such as it will if being installed under the local
SYSTEM account, it will display a warning instead of failing a package
installation.
Will not throw an error if it fails.
.INPUTS
None
.OUTPUTS
None
.PARAMETER TargetFilePath
This is the location to the application/executable file that you want to
add a shortcut to on the desktop. This is mandatory.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
# This will create a new Desktop Shortcut pointing at the NHibernate
# Profiler exe.
Install-ChocolateyDesktopLink -TargetFilePath "C:\tools\NHibernatProfiler\nhprof.exe"
.LINK
Install-ChocolateyShortcut
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $targetFilePath,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if (!$targetFilePath) {
throw "Install-ChocolateyDesktopLink - `$targetFilePath can not be null."
}
if (!(Test-Path($targetFilePath))) {
Write-Warning "'$targetFilePath' does not exist. If it is not created the shortcut will not be valid."
}
Write-Debug "Creating Shortcut..."
try {
$desktop = $([System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::DesktopDirectory))
if(!(Test-Path($desktop))) {
[System.IO.Directory]::CreateDirectory($desktop) | Out-Null
}
$link = Join-Path $desktop "$([System.IO.Path]::GetFileName($targetFilePath)).lnk"
$workingDirectory = $([System.IO.Path]::GetDirectoryName($targetFilePath))
$wshshell = New-Object -ComObject WScript.Shell
$lnk = $wshshell.CreateShortcut($link)
$lnk.TargetPath = $targetFilePath
$lnk.WorkingDirectory = $workingDirectory
$lnk.Save()
Write-Host "Desktop Shortcut created pointing at `'$targetFilePath`'."
}
catch {
Write-Warning "Unable to create desktop link. Error captured was $($_.Exception.Message)."
}
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDXjUWbYwBeM6VE
# QjEgn/zZWPz8gezmO8+atkwkszqfb6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWd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
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-ChocolateyEnvironmentVariable {
<#
.SYNOPSIS
**NOTE:** Administrative Access Required when `-VariableType 'Machine'.`
Creates a persistent environment variable.
.DESCRIPTION
Install-ChocolateyEnvironmentVariable creates an environment variable
with the specified name and value. The variable is persistent and
will remain after reboots and across multiple PowerShell and command
line sessions. The variable can be scoped either to the User or to
the Machine. If Machine level scoping is specified, the command is
elevated to an administrative session.
.NOTES
This command will assert UAC/Admin privileges on the machine when
`-VariableType Machine`.
This will add the environment variable to the current session.
.INPUTS
None
.OUTPUTS
None
.PARAMETER VariableName
The name or key of the environment variable
.PARAMETER VariableValue
A string value assigned to the above name.
.PARAMETER VariableType
Specifies whether this variable is to be accesible at either the
individual user level or at the Machine level.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
# Creates a User environment variable "JAVA_HOME" pointing to
# "d:\oracle\jdk\bin".
Install-ChocolateyEnvironmentVariable "JAVA_HOME" "d:\oracle\jdk\bin"
.EXAMPLE
>
# Creates a User environment variable "_NT_SYMBOL_PATH" pointing to
# "symsrv*symsrv.dll*f:\localsymbols*http://msdl.microsoft.com/download/symbols".
# The command will be elevated to admin priviledges.
Install-ChocolateyEnvironmentVariable `
-VariableName "_NT_SYMBOL_PATH" `
-VariableValue "symsrv*symsrv.dll*f:\localsymbols*http://msdl.microsoft.com/download/symbols" `
-VariableType Machine
.EXAMPLE
>
# Remove an environment variable
Install-ChocolateyEnvironmentVariable -VariableName 'bob' -VariableValue $null
.LINK
Uninstall-ChocolateyEnvironmentVariable
.LINK
Get-EnvironmentVariable
.LINK
Set-EnvironmentVariable
.LINK
Install-ChocolateyPath
#>
param(
[parameter(Mandatory=$false, Position=0)][string] $variableName,
[parameter(Mandatory=$false, Position=1)][string] $variableValue,
[parameter(Mandatory=$false, Position=2)]
[System.EnvironmentVariableTarget] $variableType = [System.EnvironmentVariableTarget]::User,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if ($variableType -eq [System.EnvironmentVariableTarget]::Machine) {
if (Test-ProcessAdminRights) {
Set-EnvironmentVariable -Name $variableName -Value $variableValue -Scope $variableType
} else {
$psArgs = "Install-ChocolateyEnvironmentVariable -variableName `'$variableName`' -variableValue `'$variableValue`' -variableType `'$variableType`'"
Start-ChocolateyProcessAsAdmin "$psArgs"
}
} else {
try {
Set-EnvironmentVariable -Name $variableName -Value $variableValue -Scope $variableType
} catch {
if (Test-ProcessAdminRights) {
# HKCU:\Environment may not exist, which happens sometimes with Server Core
Set-EnvironmentVariable -Name $variableName -Value $variableValue -Scope Machine
} else {
throw $_.Exception
}
}
}
Set-Content env:\$variableName $variableValue
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCATL+MDH48zSNqQ
# POXtlcVjPFzaFJ7+F+aQjLRAlSbXP6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydC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QOMdew3IN29PUa7tei4l+ZcWS7Ef/fV
# XdhPBBd3F6ksdJQdpK+jN10dnpDxbqzRDtOcB4JMH106DwLBkcgq5j6qJBzNxAd4
# s1TyNd5TKugK0SNBOFlsbzuD411ejfT5ar9PlmEwrMl9j+kSjEo8LzHEg+g44AC+
# sy7I6amENO/9J9ECuK4JDc6gY3v7F/n/Z6sqJhb3P5tFPPgHYuuMm969ig==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-ChocolateyFileAssociation {
<#
.SYNOPSIS
**NOTE:** Administrative Access Required.
Creates an association between a file extension and a executable.
.DESCRIPTION
Install-ChocolateyFileAssociation can associate a file extension
with a downloaded application. Once this command has created an
association, all invocations of files with the specified extension
will be opened via the executable specified.
.NOTES
This command will assert UAC/Admin privileges on the machine.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Extension
The file extension to be associated.
.PARAMETER Executable
The path to the application's executable to be associated.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
# This will create an association between Sublime Text 2 and all .txt
# files. Any .txt file opened will by default open with Sublime Text 2.
$sublimeDir = (Get-ChildItem $env:ALLUSERSPROFILE\chocolatey\lib\sublimetext* | select $_.last)
$sublimeExe = "$sublimeDir\tools\sublime_text.exe"
Install-ChocolateyFileAssociation ".txt" $sublimeExe
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $extension,
[parameter(Mandatory=$true, Position=1)][string] $executable,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if(-not(Test-Path $executable)){
$errorMessage = "`'$executable`' does not exist, not able to create association"
Write-Error $errorMessage
throw $errorMessage
}
$extension=$extension.trim()
if(-not($extension.StartsWith("."))) {
$extension = ".$extension"
}
$fileType = Split-Path $executable -leaf
$fileType = $fileType.Replace(" ","_")
$elevated = @"
cmd /c "assoc $extension=$fileType"
cmd /c 'ftype $fileType="$executable" "%1" "%*"'
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Set-ItemProperty -Path "HKCR:\$fileType" -Name "(Default)" -Value "$fileType file" -ErrorAction Stop
"@
Start-ChocolateyProcessAsAdmin $elevated
Write-Host "`'$extension`' has been associated with `'$executable`'"
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC/+KJq4UixyZ9F
# Cm7Klp+BUABbcUrcUcLUeO7ntTctFqCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBA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signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-ChocolateyPackage {
<#
.SYNOPSIS
**NOTE:** Administrative Access Required.
Installs software into "Programs and Features" based on a remote file
download. Use Install-ChocolateyInstallPackage when local or embedded
file.
.DESCRIPTION
This will download a native installer from a url and install it on your
machine. Has error handling built in.
If you are embedding the file(s) directly in the package (or do not need
to download a file first), use Install-ChocolateyInstallPackage instead.
.NOTES
This command will assert UAC/Admin privileges on the machine.
This is a native installer wrapper function. A "true" package will
contain all the run time files and not an installer. That could come
pre-zipped and require unzipping in a PowerShell script. Chocolatey
works best when the packages contain the software it is managing. Most
software in the Windows world comes as installers and Chocolatey
understands how to work with that, hence this wrapper function.
Chocolatey works best when the packages contain the software it is
managing and doesn't require downloads. However most software in the
Windows world requires redistribution rights and when sharing packages
publicly (like on the community feed), maintainers may not have those
aforementioned rights. Chocolatey understands how to work with that,
hence this function. You are not subject to this limitation with
internal packages.
.INPUTS
None
.OUTPUTS
None
.PARAMETER PackageName
The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.
.PARAMETER FileType
This is the extension of the file. This can be 'exe', 'msi', or 'msu'.
Licensed editions of Chocolatey use this to automatically determine
silent arguments. If this is not provided, Chocolatey will
automatically determine this using the downloaded file's extension.
.PARAMETER SilentArgs
OPTIONAL - These are the parameters to pass to the native installer,
including any arguments to make the installer silent/unattended.
Licensed editions of Chocolatey will automatically determine the
installer type and merge the arguments with what is provided here.
Try any of the to get the silent (unattended) installer -
`/s /S /q /Q /quiet /silent /SILENT /VERYSILENT`. With msi it is always
`/quiet`. Please pass it in still but it will be overridden by
Chocolatey to `/quiet`. If you don't pass anything it could invoke the
installer with out any arguments. That means a nonsilent installer.
Please include the `notSilent` tag in your Chocolatey package if you
are not setting up a silent/unattended package. Please note that if you
are submitting to the community repository, it is nearly a requirement
for the package to be completely unattended.
.PARAMETER Url
This is the 32 bit url to download the resource from. This resource can
be used on 64 bit systems when a package has both a Url and Url64bit
specified if a user passes `--forceX86`. If there is only a 64 bit url
available, please remove do not use the paramter (only use Url64bit).
Will fail on 32bit systems if missing or if a user attempts to force
a 32 bit installation on a 64 bit system.
Prefer HTTPS when available. Can be HTTP, FTP, or File URIs.
In 0.10.6+, `File` and `FileFullPath` are aliases for Url.
.PARAMETER Url64bit
OPTIONAL - If there is a 64 bit resource available, use this
parameter. Chocolatey will automatically determine if the user is
running a 64 bit OS or not and adjust accordingly. Please note that
the 32 bit url will be used in the absence of this. This parameter
should only be used for 64 bit native software. If the original Url
contains both (which is quite rare), set this to '$url' Otherwise remove
this parameter.
Prefer HTTPS when available. Can be HTTP, FTP, or File URIs.
In 0.10.6+, `File64` and `FileFullPath64` are aliases for Url64Bit.
.PARAMETER ValidExitCodes
Array of exit codes indicating success. Defaults to `@(0)`.
.PARAMETER Checksum
The checksum hash value of the Url resource. This allows a checksum to
be validated for files that are not local. The checksum type is covered
by ChecksumType.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
**NOTE:** To determine checksums, you can get that from the original
site if provided. You can also use the [checksum tool available on
the community feed](https://chocolatey.org/packages/checksum) (`choco install checksum`)
and use it e.g. `checksum -t sha256 -f path\to\file`. Ensure you
provide checksums for all remote resources used.
.PARAMETER ChecksumType
The type of checkum that the file is validated with - valid
values are 'md5', 'sha1', 'sha256' or 'sha512' - defaults to 'md5'.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER Checksum64
OPTIONAL if no Url64bit - The checksum hash value of the Url64bit
resource. This allows a checksum to be validated for files that are not
local. The checksum type is covered by ChecksumType64.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
.PARAMETER ChecksumType64
OPTIONAL - The type of checkum that the file is validated with - valid
values are 'md5', 'sha1', 'sha256' or 'sha512' - defaults to
ChecksumType parameter value.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER Options
OPTIONAL - Specify custom headers. Available in 0.9.10+.
.PARAMETER UseOnlyPackageSilentArguments
Do not allow choco to provide/merge additional silent arguments and only
use the ones available with the package. Available in 0.9.10+.
.PARAMETER UseOriginalLocation
Do not download the resources. This is typically passed if Url/Url64bit
are pointed to local files or files on a share and those files should
be used in place. Available in 0.10.1+.
NOTE: You can also use `Install-ChocolateyInstallPackage` for the same
functionality (see links).
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
$packageName= 'bob'
$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)"
$url = 'https://somewhere.com/file.msi'
$url64 = 'https://somewhere.com/file-x64.msi'
$packageArgs = @{
packageName = $packageName
fileType = 'msi'
url = $url
url64bit = $url64
silentArgs = "/qn /norestart"
validExitCodes= @(0, 3010, 1641)
softwareName = 'Bob*'
checksum = '12345'
checksumType = 'sha256'
checksum64 = '123356'
checksumType64= 'sha256'
}
Install-ChocolateyPackage @packageArgs
.EXAMPLE
>
Install-ChocolateyPackage 'StExBar' 'msi' '/quiet' `
'http://stexbar.googlecode.com/files/StExBar-1.8.3.msi' `
'http://stexbar.googlecode.com/files/StExBar64-1.8.3.msi'
.EXAMPLE
>
Install-ChocolateyPackage 'mono' 'exe' '/SILENT' `
'http://somehwere/something.exe' -ValidExitCodes @(0,21)
.EXAMPLE
>
Install-ChocolateyPackage 'ruby.devkit' 'exe' '/SILENT' `
'http://cdn.rubyinstaller.org/archives/devkits/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe' `
'http://cdn.rubyinstaller.org/archives/devkits/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe' `
-checksum '9383f12958aafc425923e322460a84de' -checksumType 'md5' `
-checksum64 'ce99d873c1acc8bffc639bd4e764b849'
.EXAMPLE
Install-ChocolateyPackage 'bob' 'exe' '/S' 'https://somewhere/bob.exe' 'https://somewhere/bob-x64.exe'
.EXAMPLE
>
$options =
@{
Headers = @{
Accept = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
'Accept-Charset' = 'ISO-8859-1,utf-8;q=0.7,*;q=0.3';
'Accept-Language' = 'en-GB,en-US;q=0.8,en;q=0.6';
Cookie = 'requiredinfo=info';
Referer = 'https://somelocation.com/';
}
}
Install-ChocolateyPackage -PackageName 'package' -FileType 'exe' -SilentArgs '/S' 'https://somelocation.com/thefile.exe' -Options $options
.LINK
Get-ChocolateyWebFile
.LINK
Install-ChocolateyInstallPackage
.LINK
Get-UninstallRegistryKey
.LINK
Install-ChocolateyZipPackage
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $packageName,
[parameter(Mandatory=$false, Position=1)]
[alias("installerType","installType")][string] $fileType = 'exe',
[parameter(Mandatory=$false, Position=2)][string[]] $silentArgs = '',
[alias("file","fileFullPath")][parameter(Mandatory=$false, Position=3)][string] $url = '',
[parameter(Mandatory=$false, Position=4)]
[alias("url64","file64","fileFullPath64")][string] $url64bit = '',
[parameter(Mandatory=$false)] $validExitCodes = @(0),
[parameter(Mandatory=$false)][string] $checksum = '',
[parameter(Mandatory=$false)][string] $checksumType = '',
[parameter(Mandatory=$false)][string] $checksum64 = '',
[parameter(Mandatory=$false)][string] $checksumType64 = '',
[parameter(Mandatory=$false)][hashtable] $options = @{Headers=@{}},
[parameter(Mandatory=$false)]
[alias("useOnlyPackageSilentArgs")][switch] $useOnlyPackageSilentArguments = $false,
[switch]$useOriginalLocation,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
[string]$silentArgs = $silentArgs -join ' '
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$chocTempDir = $env:TEMP
$tempDir = Join-Path $chocTempDir "$($env:chocolateyPackageName)"
if ($env:chocolateyPackageVersion -ne $null) {$tempDir = Join-Path $tempDir "$($env:chocolateyPackageVersion)"; }
$tempDir = $tempDir -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'
if (![System.IO.Directory]::Exists($tempDir)) { [System.IO.Directory]::CreateDirectory($tempDir) | Out-Null }
$file = Join-Path $tempDir "$($packageName)Install.$fileType"
[string]$filePath = $file
if ($useOriginalLocation) {
$filePath = $url
if (Get-ProcessorBits 64) {
$forceX86 = $env:chocolateyForceX86
if ($forceX86) {
Write-Debug "User specified '-x86' so forcing 32-bit"
} else {
if ($url64bit -ne $null -and $url64bit -ne '') {
$filePath = $url64bit
}
}
}
} else {
$filePath = Get-ChocolateyWebFile -PackageName $packageName `
-FileFullPath $file `
-Url $url `
-Url64bit $url64bit `
-Checksum $checksum `
-ChecksumType $checksumType `
-Checksum64 $checksum64 `
-ChecksumType64 $checksumType64 `
-Options $options `
-GetOriginalFileName
}
Install-ChocolateyInstallPackage -PackageName $packageName `
-FileType $fileType `
-SilentArgs $silentArgs `
-File $filePath `
-ValidExitCodes $validExitCodes `
-UseOnlyPackageSilentArguments:$useOnlyPackageSilentArguments
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCbji53Ols2kgkb
# i1Iw59PnBsZFZM7q2mVxpXuLxnp976CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj6YgsIJWuHEqH
# CN8M9eJNYBi+qsSyrnAxZjNxPqxwoqvOf+l8y5Kh5TsxHM/q8grkV7tKtel05iv+
#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MRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDI5WjAjBgkqhkiG9w0BCQQxFgQUsERc5g6nOowXz9+d
# dAxfcON0LpswDQYJKoZIhvcNAQEBBQAEggEAb5q2AtnwRQBNLcMxTi/jge7AFYXa
# Pe3fDYVQFwMHKhOwmhyIz/ao9iZBHEqO/zZ35NrLUPx1egHwbKrAjh6cnhMUl1U5
# sXcZHyvyOMyI+1JQcUE3Sx//jGuBb37OILpd8tRt9lt9FpAJJxAp8Zv4Ur1itnME
# dTwNfavSvCjmOruoYMnF0Z8qE8OzqUfq31Cr4FfCEeUuLKaB2RO+Kqoxbzko1yLO
# lD1rkK5+q1Cfas9s3JqIyZo9jJ+FoK/4OugmvxtxF1pUgsxfBjX14YG1kWZkE5yp
# 5tCoj2QatSZZq7rcQAmhew2OkRlCfQu8SewvKZCB8wuX00wVuXnQLpuDuw==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-ChocolateyPath {
<#
.SYNOPSIS
**NOTE:** Administrative Access Required when `-PathType 'Machine'.`
This puts a directory to the PATH environment variable.
.DESCRIPTION
Looks at both PATH environment variables to ensure a path variable
correctly shows up on the right PATH.
.NOTES
This command will assert UAC/Admin privileges on the machine if
`-PathType 'Machine'`.
This is used when the application/tool is not being linked by Chocolatey
(not in the lib folder).
.INPUTS
None
.OUTPUTS
None
.PARAMETER PathToInstall
The full path to a location to add / ensure is in the PATH.
.PARAMETER PathType
Which PATH to add it to. If specifying `Machine`, this requires admin
privileges to run correctly.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Install-ChocolateyPath -PathToInstall "$($env:SystemDrive)\tools\gittfs"
.EXAMPLE
Install-ChocolateyPath "$($env:SystemDrive)\Program Files\MySQL\MySQL Server 5.5\bin" -PathType 'Machine'
.LINK
Install-ChocolateyEnvironmentVariable
.LINK
Get-EnvironmentVariable
.LINK
Set-EnvironmentVariable
.LINK
Get-ToolsLocation
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $pathToInstall,
[parameter(Mandatory=$false, Position=1)][System.EnvironmentVariableTarget] $pathType = [System.EnvironmentVariableTarget]::User,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-Debug "Running 'Install-ChocolateyPath' with pathToInstall:`'$pathToInstall`'";
$originalPathToInstall = $pathToInstall
#get the PATH variable
Update-SessionEnvironment
$envPath = $env:PATH
if (!$envPath.ToLower().Contains($pathToInstall.ToLower()))
{
Write-Host "PATH environment variable does not have $pathToInstall in it. Adding..."
$actualPath = Get-EnvironmentVariable -Name 'Path' -Scope $pathType -PreserveVariables
$statementTerminator = ";"
#does the path end in ';'?
$hasStatementTerminator = $actualPath -ne $null -and $actualPath.EndsWith($statementTerminator)
# if the last digit is not ;, then we are adding it
If (!$hasStatementTerminator -and $actualPath -ne $null) {$pathToInstall = $statementTerminator + $pathToInstall}
if (!$pathToInstall.EndsWith($statementTerminator)) {$pathToInstall = $pathToInstall + $statementTerminator}
$actualPath = $actualPath + $pathToInstall
if ($pathType -eq [System.EnvironmentVariableTarget]::Machine) {
if (Test-ProcessAdminRights) {
Set-EnvironmentVariable -Name 'Path' -Value $actualPath -Scope $pathType
} else {
$psArgs = "Install-ChocolateyPath -pathToInstall `'$originalPathToInstall`' -pathType `'$pathType`'"
Start-ChocolateyProcessAsAdmin "$psArgs"
}
} else {
Set-EnvironmentVariable -Name 'Path' -Value $actualPath -Scope $pathType
}
#add it to the local path as well so users will be off and running
$envPSPath = $env:PATH
$env:Path = $envPSPath + $statementTerminator + $pathToInstall
}
}
# [System.Text.RegularExpressions.Regex]::Match($Path,[System.Text.RegularExpressions.Regex]::Escape('locationtoMatch') + '(?>;)?', '', [System.Text.RegularExpressions.RegexOptions]::IgnoreCase)
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC0ts+gbkF9RiuX
# VrIVyzppyVIoR4jNra4XW0t75VfOfKCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
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MQCrbgIaOiusjYe6NvyzWqGMJC0qBVJcyN8wc1h
# vFAQ6Ps6EihhlZqWxmPegH12B9iBGRJoYXOrsga2p2yaG/WURr5ZMa5nlsJGFnP6
# SFjeWtFnqCrgRc3bJTX/9kEXv+wdbHAPEYwI5H1qttYLUkcbY1wPDtLLh/0z85SL
# nhUWKcz/k8lKpE9ATcm9KfoOV+YhsPDFBptXUUVipuMD3Y/NYrblvaGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDI5WjAjBgkqhkiG9w0BCQQxFgQU8K12RBcUNlyd+mJe
# jzcGoRMUlbwwDQYJKoZIhvcNAQEBBQAEggEAAfKHXSxUaXE7suDLWPp+XOjm3gz9
# XWgS6xw1IfKNOBtb2KcU54iz9jA1+kHvA5fYiv+zL/FQF4lQbxW3RQ9459FM7tJT
# vppJtQHr6hd7KO6wISXipzWPb/5bXzPZ5b0fXPVYwLhWf74SsS+AQEIqr5jAprrv
# WEFLU9JhtrzaSt2j5pdrdKSSSKzMsxUdwtVb2yTdzO/7Q6mIAqfs54iFVcPjF9uq
# xs1JMcuJQLDdn7pf+TiZ7973ujWA5BNryKG9EUJPZdisU5mBCPTf+aBTX9lIck/+
# zggI33lcrVPEjbbVYytjLU+H0Q+brz7Hx2l6Yf+sYABUxJyEKqMyQSxx2w==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-ChocolateyPowershellCommand {
<#
.SYNOPSIS
Installs a PowerShell Script as a command
.DESCRIPTION
This will install a PowerShell script as a command on your system. Like
an executable can be run from a batch redirect, this will do the same,
calling PowerShell with this command and passing your arguments to it.
If you include a url, it will first download the PowerShell file.
.NOTES
Chocolatey works best when the packages contain the software it is
managing and doesn't require downloads. However most software in the
Windows world requires redistribution rights and when sharing packages
publicly (like on the community feed), maintainers may not have those
aforementioned rights. Chocolatey understands how to work with that,
hence this function. You are not subject to this limitation with
internal packages.
.INPUTS
None
.OUTPUTS
None
.PARAMETER PackageName
The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.
.PARAMETER PsFileFullPath
Full file path to PowerShell file to turn into a command. If embedding
it in the package next to the install script, the path will be like
`"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\\Script.ps1"`
.PARAMETER Url
This is the 32 bit url to download the resource from. This resource can
be used on 64 bit systems when a package has both a Url and Url64bit
specified if a user passes `--forceX86`. If there is only a 64 bit url
available, please remove do not use the parameter (only use Url64bit).
Will fail on 32bit systems if missing or if a user attempts to force
a 32 bit installation on a 64 bit system.
Prefer HTTPS when available. Can be HTTP, FTP, or File URIs.
.PARAMETER Url64bit
OPTIONAL - If there is a 64 bit resource available, use this
parameter. Chocolatey will automatically determine if the user is
running a 64 bit OS or not and adjust accordingly. Please note that
the 32 bit url will be used in the absence of this. This parameter
should only be used for 64 bit native software. If the original Url
contains both (which is quite rare), set this to '$url' Otherwise remove
this parameter.
Prefer HTTPS when available. Can be HTTP, FTP, or File URIs.
.PARAMETER Checksum
The checksum hash value of the Url resource. This allows a checksum to
be validated for files that are not local. The checksum type is covered
by ChecksumType.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
.PARAMETER ChecksumType
The type of checkum that the file is validated with - valid
values are 'md5', 'sha1', 'sha256' or 'sha512' - defaults to 'md5'.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER Checksum64
OPTIONAL if no Url64bit - The checksum hash value of the Url64bit
resource. This allows a checksum to be validated for files that are not
local. The checksum type is covered by ChecksumType64.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
**NOTE:** To determine checksums, you can get that from the original
site if provided. You can also use the [checksum tool available on
the community feed](https://chocolatey.org/packages/checksum) (`choco install checksum`)
and use it e.g. `checksum -t sha256 -f path\to\file`. Ensure you
provide checksums for all remote resources used.
.PARAMETER ChecksumType64
OPTIONAL - The type of checkum that the file is validated with - valid
values are 'md5', 'sha1', 'sha256' or 'sha512' - defaults to
ChecksumType parameter value.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER Options
OPTIONAL - Specify custom headers. Available in 0.9.10+.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
$psFile = Join-Path $(Split-Path -Parent $MyInvocation.MyCommand.Definition) "Install-WindowsImage.ps1"
Install-ChocolateyPowershellCommand -PackageName 'installwindowsimage.powershell' -PSFileFullPath $psFile
.EXAMPLE
>
$psFile = Join-Path $(Split-Path -Parent $MyInvocation.MyCommand.Definition) `
"Install-WindowsImage.ps1"
Install-ChocolateyPowershellCommand `
-PackageName 'installwindowsimage.powershell' `
-PSFileFullPath $psFile `
-PSFileFullPath $psFile `
-Url 'http://somewhere.com/downloads/Install-WindowsImage.ps1'
.EXAMPLE
>
$psFile = Join-Path $(Split-Path -Parent $MyInvocation.MyCommand.Definition) `
"Install-WindowsImage.ps1"
Install-ChocolateyPowershellCommand `
-PackageName 'installwindowsimage.powershell' `
-PSFileFullPath $psFile `
-Url 'http://somewhere.com/downloads/Install-WindowsImage.ps1' `
-Url64 'http://somewhere.com/downloads/Install-WindowsImagex64.ps1'
.LINK
Get-ChocolateyWebFile
.LINK
Install-ChocolateyInstallPackage
.LINK
Install-ChocolateyPackage
.LINK
Install-ChocolateyZipPackage
#>
param(
[parameter(Mandatory=$false, Position=0)][string] $packageName,
[parameter(Mandatory=$true, Position=1)][string] $psFileFullPath,
[parameter(Mandatory=$false, Position=2)][string] $url ='',
[parameter(Mandatory=$false, Position=3)]
[alias("url64")][string] $url64bit = '',
[parameter(Mandatory=$false)][string] $checksum = '',
[parameter(Mandatory=$false)][string] $checksumType = '',
[parameter(Mandatory=$false)][string] $checksum64 = '',
[parameter(Mandatory=$false)][string] $checksumType64 = '',
[parameter(Mandatory=$false)][hashtable] $options = @{Headers=@{}},
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-Debug "Running 'Install-ChocolateyPowershellCommand' for $packageName with psFileFullPath:`'$psFileFullPath`', url: `'$url`', url64bit:`'$url64bit`', checkSum: `'$checksum`', checksumType: `'$checksumType`', checkSum64: `'$checksum64`', checksumType64: `'$checksumType64`' ";
if ($url -ne '') {
Get-ChocolateyWebFile $packageName $psFileFullPath $url $url64bit -checksum $checksum -checksumType $checksumType -checksum64 $checksum64 -checksumType64 $checksumType64 -Options $options
}
if ($env:chocolateyPackageName -ne $null -and $env:chocolateyPackageName -eq $env:ChocolateyInstallDirectoryPackage) {
Write-Warning "Install Directory override not available for PowerShell command packages."
}
$nugetPath = $(Split-Path -parent $helpersPath)
$nugetExePath = Join-Path $nuGetPath 'bin'
$cmdName = [System.IO.Path]::GetFileNameWithoutExtension($psFileFullPath)
$packageBatchFileName = Join-Path $nugetExePath "$($cmdName).bat"
Write-Host "Adding $packageBatchFileName and pointing it to powershell command $psFileFullPath"
"@echo off
powershell -NoProfile -ExecutionPolicy unrestricted -Command ""& `'$psFileFullPath`' %*"""| Out-File $packageBatchFileName -encoding ASCII
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDCZ+tEzGSWhHxv
# o26A34EwXrGzEKANV2zSoG9DQPIm1aCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5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G # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-ChocolateyShortcut {
<#
.SYNOPSIS
Creates a shortcut
.DESCRIPTION
This adds a shortcut, at the specified location, with the option to specify
a number of additional properties for the shortcut, such as Working Directory,
Arguments, Icon Location, and Description.
.NOTES
If this errors, as it may if being run under the local SYSTEM account with
particular folder that SYSTEM doesn't have, it will display a warning instead
of failing a package installation.
.INPUTS
None
.OUTPUTS
None
.PARAMETER ShortcutFilePath
The full absolute path to where the shortcut should be created.
.PARAMETER TargetPath
The full absolute path to the target for new shortcut.
.PARAMETER WorkingDirectory
OPTIONAL - The full absolute path of the Working Directory that will be
used by the new shortcut.
.PARAMETER Arguments
OPTIONAL - Additonal arguments that should be passed along to the new
shortcut.
.PARAMETER IconLocation
OPTIONAL- The full absolute path to an icon file to be used for the new
shortcut.
.PARAMETER Description
OPTIONAL - A text description to be associated with the new description.
.PARAMETER WindowStyle
OPTIONAL - Type of windows target application should open with.
Available in 0.9.10+.
0 = Hidden, 1 = Normal Size, 3 = Maximized, 7 - Minimized.
Full list table 3.9 here: https://technet.microsoft.com/en-us/library/ee156605.aspx
.PARAMETER RunAsAdmin
OPTIONAL - Set "Run As Administrator" checkbox for the created the
shortcut. Available in 0.9.10+.
.PARAMETER PinToTaskbar
OPTIONAL - Pin the new shortcut to the taskbar. Available in 0.9.10+.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
# This will create a new shortcut at the location of "C:\test.lnk" and
# link to the file located at "C:\text.exe"
Install-ChocolateyShortcut -ShortcutFilePath "C:\test.lnk" -TargetPath "C:\test.exe"
.EXAMPLE
>
# This will create a new shortcut at the location of "C:\notepad.lnk"
# and link to the Notepad application. In addition, other properties
# are being set to specify the working directory, an icon to be used for
# the shortcut, along with a description and arguments.
Install-ChocolateyShortcut `
-ShortcutFilePath "C:\notepad.lnk" `
-TargetPath "C:\Windows\System32\notepad.exe" `
-WorkDirectory "C:\" `
-Arguments "C:\test.txt" `
-IconLocation "C:\test.ico" `
-Description "This is the description"
.EXAMPLE
>
# Creates a new notepad shortcut on the root of c: that starts
# notepad.exe as Administrator. Shortcut is also pinned to taskbar.
# These parameters are available in 0.9.10+.
Install-ChocolateyShortcut `
-ShortcutFilePath "C:\notepad.lnk" `
-TargetPath "C:\Windows\System32\notepad.exe" `
-WindowStyle 3 `
-RunAsAdmin `
-PinToTaskbar
.LINK
Install-ChocolateyDesktopLink
.LINK
Install-ChocolateyExplorerMenuItem
.LINK
Install-ChocolateyPinnedTaskBarItem
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $shortcutFilePath,
[parameter(Mandatory=$true, Position=1)][string] $targetPath,
[parameter(Mandatory=$false, Position=2)][string] $workingDirectory,
[parameter(Mandatory=$false, Position=3)][string] $arguments,
[parameter(Mandatory=$false, Position=4)][string] $iconLocation,
[parameter(Mandatory=$false, Position=5)][string] $description,
[parameter(Mandatory=$false, Position=6)][int] $windowStyle,
[parameter(Mandatory=$false)][switch] $runAsAdmin,
[parameter(Mandatory=$false)][switch] $pinToTaskbar,
[parameter(ValueFromRemainingArguments = $true)][Object[]]$ignoredArguments
)
Write-Debug "Running 'Install-ChocolateyShortcut' with parameters ShortcutFilePath: `'$shortcutFilePath`', TargetPath: `'$targetPath`', WorkingDirectory: `'$workingDirectory`', Arguments: `'$arguments`', IconLocation: `'$iconLocation`', Description: `'$description`', WindowStyle: `'$windowStyle`', RunAsAdmin: `'$runAsAdmin`', PinToTaskbar: `'$pinToTaskbar`'";
# http://powershell.com/cs/blogs/tips/archive/2009/02/05/validating-a-url.aspx
function isURIWeb($address) {
$uri = $address -as [System.URI]
$uri.AbsoluteURI -ne $null -and $uri.Scheme -match '[http|https]'
}
if (!$shortcutFilePath) {
# shortcut file path could be null if someone is trying to get special
# paths for LocalSystem (SYSTEM).
Write-Warning "Unable to create shortcut. `$shortcutFilePath can not be null."
return
}
$shortcutDirectory = $([System.IO.Path]::GetDirectoryName($shortcutFilePath))
if (!(Test-Path($shortcutDirectory))) {
[System.IO.Directory]::CreateDirectory($shortcutDirectory) | Out-Null
}
if (!$targetPath) {
throw "Install-ChocolateyShortcut - `$targetPath can not be null."
}
if(!(Test-Path($targetPath)) -and !(IsURIWeb($targetPath))) {
Write-Warning "'$targetPath' does not exist. If it is not created the shortcut will not be valid."
}
if($iconLocation) {
if(!(Test-Path($iconLocation))) {
Write-Warning "'$iconLocation' does not exist. A default icon will be used."
}
}
if ($workingDirectory) {
if (!(Test-Path($workingDirectory))) {
[System.IO.Directory]::CreateDirectory($workingDirectory) | Out-Null
}
}
Write-Debug "Creating Shortcut..."
try {
$global:WshShell = New-Object -com "WScript.Shell"
$lnk = $global:WshShell.CreateShortcut($shortcutFilePath)
$lnk.TargetPath = $targetPath
$lnk.WorkingDirectory = $workingDirectory
$lnk.Arguments = $arguments
if($iconLocation) {
$lnk.IconLocation = $iconLocation
}
if ($description) {
$lnk.Description = $description
}
if ($windowStyle) {
$lnk.WindowStyle = $windowStyle
}
$lnk.Save()
Write-Debug "Shortcut created."
[System.IO.FileInfo]$Path = $shortcutFilePath
If ($runAsAdmin) {
#In order to enable the "Run as Admin" checkbox, this code reads the .LNK as a stream
# and flips a specific bit while writing a new copy. It then replaces the original
# .LNK with the copy, similar to this example: http://poshcode.org/2513
$TempFileName = [IO.Path]::GetRandomFileName()
$TempFile = [IO.FileInfo][IO.Path]::Combine($Path.Directory, $TempFileName)
$Writer = New-Object System.IO.FileStream $TempFile, ([System.IO.FileMode]::Create)
$Reader = $Path.OpenRead()
While ($Reader.Position -lt $Reader.Length) {
$Byte = $Reader.ReadByte()
If ($Reader.Position -eq 22) {$Byte = 34}
$Writer.WriteByte($Byte)
}
$Reader.Close()
$Writer.Close()
$Path.Delete()
Rename-Item -Path $TempFile -NewName $Path.Name | Out-Null
}
If ($pinToTaskbar) {
$scfilename = $Path.FullName
$pinverb = (new-object -com "shell.application").namespace($(split-path -parent $Path.FullName)).Parsename($(split-path -leaf $Path.FullName)).verbs() | ?{$_.Name -eq 'Pin to Tas&kbar'}
If ($pinverb) {$pinverb.doit()}
}
}
catch {
Write-Warning "Unable to create shortcut. Error captured was $($_.Exception.Message)."
}
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAYdVe5UrJIl34L
# JbtOP9JzSjRJSGyG/V/J6NxAGlgZ06CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
#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2lP/UjBS4fJKF1FirTm517yothnQGVvEfww01+fx
# g/cVFfOY7oCLO/rNKqRB6jyjnr2IWSG0+KHwsUoZjNUMzW7NFOEE4MgKtIRsIJzA
# FIjt0LaDL91PYoxefmfDJlFYV1/yMquh38BFJFlhRoSR7U1HJb1qBr3Y3tmydwi4
# BqKbu26hmMxmzjZnXQMtIA/Y69+g94u1EEYhZ3Qjqwc926HEQ3yUdqGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMwWjAjBgkqhkiG9w0BCQQxFgQUSFpBBBPRxhMH3uVB
# TXUUHzWrCvIwDQYJKoZIhvcNAQEBBQAEggEAKSk4UjaFcWQKRkcdHoOhNmwb8TfV
# GyozvHETZ0/kk/3b6ThOSGx3nh/u02Eb/imLFrSvqk8ho2QOHYhLQd5173Ru3gOb
# g+YQW83MvmjotALp5V6WECbxvVMgwx2GJF9Z8G9DmnD4a2XakviOJa//igZukhyc
# Cq/gXthoYOT416HN0cSKMnhU2Yo8DpxU4P08kgrR8+3XLfEuX9UqTLsYF295AnTs
# DeUw1c+CuPVIyE/CVrsswcZIiRVZ9o4uDQHKBcksrX1pbtGo30LG0Qo3ZL0l4bZk
# HW3BKaEvu6qL6P3duoj9XVOEbKojwLz1bCsl121hRvbW37GgLvDvq61GOg==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-ChocolateyVsixPackage {
<#
.SYNOPSIS
Downloads and installs a VSIX package for Visual Studio
.DESCRIPTION
VSIX packages are Extensions for the Visual Studio IDE. The Visual
Studio Gallery at http://visualstudiogallery.msdn.microsoft.com/ is the
public extension feed and hosts thousands of extensions. You can locate
a VSIX Url by finding the download link of Visual Studio extensions on
the Visual Studio Gallery.
.NOTES
Chocolatey works best when the packages contain the software it is
managing and doesn't require downloads. However most software in the
Windows world requires redistribution rights and when sharing packages
publicly (like on the community feed), maintainers may not have those
aforementioned rights. Chocolatey understands how to work with that,
hence this function. You are not subject to this limitation with
internal packages.
.INPUTS
None
.OUTPUTS
None
.PARAMETER PackageName
The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.
In 0.10.4+, `Name` is an alias for PackageName.
.PARAMETER VsixUrl
The URL of the package to be installed.
Prefer HTTPS when available. Can be HTTP, FTP, or File URIs.
In 0.10.4+, `Url` is an alias for VsixUrl.
.PARAMETER VsVersion
The major version number of Visual Studio where the
package should be installed. This is optional. If not
specified, the most recent Visual Studio installation
will be targetted.
NOTE: For Visual Studio 2015, the VsVersion is 14. It can be determined
by looking at the folders under Program Files / Program Files (x86).
In 0.10.4+, `VisualStudioVersion` is an alias for VsVersion.
.PARAMETER Checksum
The checksum hash value of the Url resource. This allows a checksum to
be validated for files that are not local. The checksum type is covered
by ChecksumType.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
**NOTE:** To determine checksums, you can get that from the original
site if provided. You can also use the [checksum tool available on
the community feed](https://chocolatey.org/packages/checksum) (`choco install checksum`)
and use it e.g. `checksum -t sha256 -f path\to\file`. Ensure you
provide checksums for all remote resources used.
.PARAMETER ChecksumType
The type of checkum that the file is validated with - valid
values are 'md5', 'sha1', 'sha256' or 'sha512' - defaults to 'md5'.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER Options
OPTIONAL - Specify custom headers. Available in 0.9.10+.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
# This downloads the AutoWrockTestable VSIX from the Visual Studio
# Gallery and installs it to the latest version of VS.
Install-ChocolateyVsixPackage -PackageName "MyPackage" `
-VsixUrl http://visualstudiogallery.msdn.microsoft.com/ea3a37c9-1c76-4628-803e-b10a109e7943/file/73131/1/AutoWrockTestable.vsix
.EXAMPLE
>
# This downloads the AutoWrockTestable VSIX from the Visual Studio
# Gallery and installs it to Visual Studio 2012 (v11.0).
Install-ChocolateyVsixPackage -PackageName "MyPackage" `
-VsixUrl http://visualstudiogallery.msdn.microsoft.com/ea3a37c9-1c76-4628-803e-b10a109e7943/file/73131/1/AutoWrockTestable.vsix `
-VsVersion 11
.LINK
Install-ChocolateyPackage
.LINK
Install-ChocolateyInstallPackage
.LINK
Install-ChocolateyZipPackage
#>
param(
[alias("name")][parameter(Mandatory=$true, Position=0)][string] $packageName,
[alias("url")][parameter(Mandatory=$false, Position=1)][string] $vsixUrl,
[alias("visualStudioVersion")][parameter(Mandatory=$false, Position=2)][int] $vsVersion = 0,
[parameter(Mandatory=$false)][string] $checksum = '',
[parameter(Mandatory=$false)][string] $checksumType = '',
[parameter(Mandatory=$false)][hashtable] $options = @{Headers=@{}},
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-Debug "Running 'Install-ChocolateyVsixPackage' for $packageName with vsixUrl:`'$vsixUrl`', vsVersion: `'$vsVersion`', checksum: `'$checksum`', checksumType: `'$checksumType`' ";
if($vsVersion -eq 0) {
if ([System.IntPtr]::Size -eq 4)
{
<# 32bits system case #>
$versions=(get-ChildItem HKLM:SOFTWARE\Microsoft\VisualStudio -ErrorAction SilentlyContinue | ? { ($_.PSChildName -match "^[0-9\.]+$") } | ? {$_.property -contains "InstallDir"} | sort {[int]($_.PSChildName)} -descending)
}
else
{
$versions=(get-ChildItem HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio -ErrorAction SilentlyContinue | ? { ($_.PSChildName -match "^[0-9\.]+$") } | ? {$_.property -contains "InstallDir"} | sort {[int]($_.PSChildName)} -descending)
}
if($versions -and $versions.Length){
$version = $versions[0]
}elseif($versions){
$version = $versions
}
}
else {
if ([System.IntPtr]::Size -eq 4)
{
<# 32bits system case #>
$versions=(get-ChildItem HKLM:SOFTWARE\Microsoft\VisualStudio -ErrorAction SilentlyContinue | ? { ($_.PSChildName.EndsWith("$vsVersion.0")) } | ? {$_.property -contains "InstallDir"})
}
else
{
$version=(get-ChildItem HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio -ErrorAction SilentlyContinue | ? { ($_.PSChildName.EndsWith("$vsVersion.0")) } | ? {$_.property -contains "InstallDir"})
}
}
if ($version) {
$vnum=$version.PSPath.Substring($version.PSPath.LastIndexOf('\')+1)
if($vnum -as [int] -lt 10) {
throw "This installed VS version, $vnum, does not support installing VSIX packages. Version 10 is the minimum acceptable version."
}
$dir=(get-itemProperty $version.PSPath "InstallDir").InstallDir
$installer = Join-Path $dir "VsixInstaller.exe"
}
if ($installer) {
$download="$env:TEMP\$($packageName.Replace(' ','')).vsix"
try{
Get-ChocolateyWebFile $packageName $download $vsixUrl -checksum $checksum -checksumType $checksumType -Options $options
}
catch {
throw "There were errors attempting to retrieve the vsix from $vsixUrl. The error message was '$_'."
}
Write-Debug "Installing VSIX using $installer"
$exitCode = Install-Vsix "$installer" "$download"
if($exitCode -gt 0 -and $exitCode -ne 1001) { #1001: Already installed
throw "There was an error installing '$packageName'. The exit code returned was $exitCode."
}
}
else {
throw "Visual Studio is not installed or the specified version is not present."
}
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDKUWEHpUBSHC6V
# v1TDaqsROIuEaX8vkNFhHaK3XL0JDaCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxK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OUZ3h
# Toom4K+G/XFGxhiCbjiM8bvDE2GugU41nes3pb4LzRzCclUT66th4KGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMwWjAjBgkqhkiG9w0BCQQxFgQUCe4gW8MHhej0pWvW
# iq5oCsTIcvkwDQYJKoZIhvcNAQEBBQAEggEANMRMEVXnGHLxmJUKRdurooY/j8hh
# FSraFSpcKkHHmqxn7b63Nft88lXIAeNiy2hrVb0faQ99P5KQMHNZ2oQ3Ynt0rqmG
# 7ksGheZuvHr7rwQJhbF/0Oisro34pFSTD/pXYIZJ9q3HsUnPQfIez+MqZYldgjGX
# exnT48zg34/k0p1UnOi//JU1zWwmsts3B/ajgMz3hEeez7RjBORQFrv+F6oU0qZ0
# vIdCAruCT5+WjP9zpc3Z5oTYL/OmTzEksAZ1wjyus8KxBQC8c+JNBeL1gIer9PKP
# PscL/HSQUESriPvOo8M68fCa6zFm6uLmpcegrm+rJl+nw/DMn+jJ7I5xnQ==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-ChocolateyZipPackage {
<#
.SYNOPSIS
Downloads file from a url and unzips it on your machine. Use
Get-ChocolateyUnzip when local or embedded file.
.DESCRIPTION
This will download a file from a url and unzip it on your machine.
If you are embedding the file(s) directly in the package (or do not need
to download a file first), use Get-ChocolateyUnzip instead.
.NOTES
Chocolatey works best when the packages contain the software it is
managing and doesn't require downloads. However most software in the
Windows world requires redistribution rights and when sharing packages
publicly (like on the community feed), maintainers may not have those
aforementioned rights. Chocolatey understands how to work with that,
hence this function. You are not subject to this limitation with
internal packages.
.INPUTS
None
.OUTPUTS
None
.PARAMETER PackageName
The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.
.PARAMETER Url
This is the 32 bit url to download the resource from. This resource can
be used on 64 bit systems when a package has both a Url and Url64bit
specified if a user passes `--forceX86`. If there is only a 64 bit url
available, please remove do not use the paramter (only use Url64bit).
Will fail on 32bit systems if missing or if a user attempts to force
a 32 bit installation on a 64 bit system.
Prefer HTTPS when available. Can be HTTP, FTP, or File URIs.
.PARAMETER Url64bit
OPTIONAL - If there is a 64 bit resource available, use this
parameter. Chocolatey will automatically determine if the user is
running a 64 bit OS or not and adjust accordingly. Please note that
the 32 bit url will be used in the absence of this. This parameter
should only be used for 64 bit native software. If the original Url
contains both (which is quite rare), set this to '$url' Otherwise remove
this parameter.
Prefer HTTPS when available. Can be HTTP, FTP, or File URIs.
.PARAMETER UnzipLocation
This is the full path to a location to unzip the contents to, most
likely your script folder. If unzipping to your package folder, the path
will be like
`"$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\\file.exe"`
.PARAMETER Checksum
The checksum hash value of the Url resource. This allows a checksum to
be validated for files that are not local. The checksum type is covered
by ChecksumType.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
**NOTE:** To determine checksums, you can get that from the original
site if provided. You can also use the [checksum tool available on
the community feed](https://chocolatey.org/packages/checksum) (`choco install checksum`)
and use it e.g. `checksum -t sha256 -f path\to\file`. Ensure you
provide checksums for all remote resources used.
.PARAMETER ChecksumType
The type of checkum that the file is validated with - valid
values are 'md5', 'sha1', 'sha256' or 'sha512' - defaults to 'md5'.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER Checksum64
OPTIONAL if no Url64bit - The checksum hash value of the Url64bit
resource. This allows a checksum to be validated for files that are not
local. The checksum type is covered by ChecksumType64.
**NOTE:** Checksums in packages are meant as a measure to validate the
originally intended file that was used in the creation of a package is
the same file that is received at a future date. Since this is used for
other steps in the process related to the community repository, it
ensures that the file a user receives is the same file a maintainer
and a moderator (if applicable), plus any moderation review has
intended for you to receive with this package. If you are looking at a
remote source that uses the same url for updates, you will need to
ensure the package also stays updated in line with those remote
resource updates. You should look into [automatic packaging](https://chocolatey.org/docs/automatic-packages)
to help provide that functionality.
.PARAMETER ChecksumType64
OPTIONAL - The type of checkum that the file is validated with - valid
values are 'md5', 'sha1', 'sha256' or 'sha512' - defaults to
ChecksumType parameter value.
MD5 is not recommended as certain organizations need to use FIPS
compliant algorithms for hashing - see
https://support.microsoft.com/en-us/kb/811833 for more details.
The recommendation is to use at least SHA256.
.PARAMETER Options
OPTIONAL - Specify custom headers. Available in 0.9.10+.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Install-ChocolateyZipPackage -PackageName 'gittfs' -Url 'https://github.com/downloads/spraints/git-tfs/GitTfs-0.11.0.zip' -UnzipLocation $gittfsPath
.EXAMPLE
>
Install-ChocolateyZipPackage -PackageName 'sysinternals' `
-Url 'http://download.sysinternals.com/Files/SysinternalsSuite.zip' `
-UnzipLocation "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)"
.EXAMPLE
>
Install-ChocolateyZipPackage -PackageName 'sysinternals' `
-Url 'http://download.sysinternals.com/Files/SysinternalsSuite.zip' `
-UnzipLocation "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)" `
-Url64 'http://download.sysinternals.com/Files/SysinternalsSuitex64.zip'
.LINK
Get-ChocolateyWebFile
.LINK
Get-ChocolateyUnzip
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $packageName,
[parameter(Mandatory=$false, Position=1)][string] $url = '',
[parameter(Mandatory=$true, Position=2)]
[alias("destination")][string] $unzipLocation,
[parameter(Mandatory=$false, Position=3)]
[alias("url64")][string] $url64bit = '',
[parameter(Mandatory=$false)][string] $specificFolder ='',
[parameter(Mandatory=$false)][string] $checksum = '',
[parameter(Mandatory=$false)][string] $checksumType = '',
[parameter(Mandatory=$false)][string] $checksum64 = '',
[parameter(Mandatory=$false)][string] $checksumType64 = '',
[parameter(Mandatory=$false)][hashtable] $options = @{Headers=@{}},
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$fileType = 'zip'
$chocTempDir = $env:TEMP
$tempDir = Join-Path $chocTempDir "$($env:chocolateyPackageName)"
if ($env:chocolateyPackageVersion -ne $null) {$tempDir = Join-Path $tempDir "$($env:chocolateyPackageVersion)"; }
$tempDir = $tempDir -replace '\\chocolatey\\chocolatey\\', '\chocolatey\'
if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir) | Out-Null}
$file = Join-Path $tempDir "$($packageName)Install.$fileType"
$filePath = Get-ChocolateyWebFile $packageName $file $url $url64bit -checkSum $checkSum -checksumType $checksumType -checkSum64 $checkSum64 -checksumType64 $checksumType64 -options $options -getOriginalFile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NVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMwWjAjBgkqhkiG9w0BCQQxFgQUo/peYJ3AdkeuHCou
# EmI4wSwMKucwDQYJKoZIhvcNAQEBBQAEggEAYFE5296j4cmwCVVnOaU1bEIEcKCa
# //KvgzMtohQC/9vj2N9rkbklztmDC6937zgHrJWInB5i5smcAMTp3m2w2u8VgTMC
# t0ERt5kUnpYuW0Lpj1HV9jjgrDrKmd8/WZ6ojqxpJSATqwOW08GFN8053s5WS3sb
# CFC3vG9ODb+sdxTDwSg+iFo7zR+8LrWXM2murqcpklsbyKXXhf/NY4jgoLY/3UAh
# twIsmZt7o8EHmKOreUUW9g3mxp0102KFZwUi6LH9mes19iy8YE4LsZJqIZFiWOHf
# owWLM2hGkchxvEsNIwbw9rvj74BCGUVVDINyFXCNKiGNKNM9kQoPYYCRxw==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Install-Vsix {
<#
.SYNOPSIS
DO NOT USE. Not part of the public API.
.DESCRIPTION
Installs a VSIX package into a particular version of Visual Studio.
.NOTES
This is not part of the public API. Please use
Install-ChocolateyVsixPackage instead.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Installer
The path to the VSIX installer
.PARAMETER InstallFile
The VSIX file that is being installed.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.LINK
Install-ChocolateyVsixPackage
#>
param (
[parameter(Mandatory=$true, Position=0)][string] $installer,
[parameter(Mandatory=$true, Position=1)][string] $installFile,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if ($env:chocolateyPackageName -ne $null -and $env:chocolateyPackageName -eq $env:ChocolateyInstallDirectoryPackage) {
Write-Warning "Install Directory override not available for VSIX packages."
}
Write-Host "Installing $installFile using $installer"
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName=$installer
$psi.Arguments="/q $installFile"
$s = [System.Diagnostics.Process]::Start($psi)
$s.WaitForExit()
return $s.ExitCode
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDJrKHaCJ8GP289
# DJQ4kXlB8ihdRU8en4q/CDpcNkuRhaCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsT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CTg0sgC90WeA==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Set-EnvironmentVariable {
<#
.SYNOPSIS
**NOTE:** Administrative Access Required when `-Scope 'Machine'.`
DO NOT USE. Not part of the public API. Use
`Install-ChocolateyEnvironmentVariable` instead.
.DESCRIPTION
Saves an environment variable.
.NOTES
This command will assert UAC/Admin privileges on the machine if
`-Scope 'Machine'`.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Name
.PARAMETER Value
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.LINK
Install-ChocolateyEnvironmentVariable
.LINK
Uninstall-ChocolateyEnvironmentVariable
.LINK
Install-ChocolateyPath
.LINK
Get-EnvironmentVariable
#>
param (
[parameter(Mandatory=$true, Position=0)][string] $Name,
[parameter(Mandatory=$false, Position=1)][string] $Value,
[parameter(Mandatory=$false, Position=2)]
[System.EnvironmentVariableTarget] $Scope,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if ($Scope -eq [System.EnvironmentVariableTarget]::Process -or $Value -eq $null -or $Value -eq '') {
return [Environment]::SetEnvironmentVariable($Name, $Value, $Scope)
}
[string]$keyHive = 'HKEY_LOCAL_MACHINE'
[string]$registryKey = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
[Microsoft.Win32.RegistryKey] $win32RegistryKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($registryKey)
if ($Scope -eq [System.EnvironmentVariableTarget]::User) {
$keyHive = 'HKEY_CURRENT_USER'
$registryKey = "Environment"
[Microsoft.Win32.RegistryKey] $win32RegistryKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($registryKey)
}
[Microsoft.Win32.RegistryValueKind]$registryType = [Microsoft.Win32.RegistryValueKind]::String
try {
if ($win32RegistryKey.GetValueNames() -contains $Name)
{
$registryType = $win32RegistryKey.GetValueKind($Name)
}
} catch {
# the value doesn't yet exist
# move along, nothing to see here
}
Write-Debug "Registry type for $Name is/will be $registryType"
if ($Name -eq 'PATH') {
$registryType = [Microsoft.Win32.RegistryValueKind]::ExpandString
}
[Microsoft.Win32.Registry]::SetValue($keyHive + "\" + $registryKey, $Name, $Value, $registryType)
try {
# make everything refresh
# because sometimes explorer.exe just doesn't get the message that things were updated.
if (-not ("win32.nativemethods" -as [type])) {
# import sendmessagetimeout from win32
add-type -Namespace Win32 -Name NativeMethods -MemberDefinition @"
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessageTimeout(
IntPtr hWnd, uint Msg, UIntPtr wParam, string lParam,
uint fuFlags, uint uTimeout, out UIntPtr lpdwResult);
"@
}
$HWND_BROADCAST = [intptr]0xffff;
$WM_SETTINGCHANGE = 0x1a;
$result = [uintptr]::zero
# notify all windows of environment block change
[win32.nativemethods]::SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, [uintptr]::Zero, "Environment", 2, 5000, [ref]$result) | Out-Null
# Set a user environment variable making the system refresh
$setx = "$($env:SystemRoot)\System32\setx.exe"
& "$setx" ChocolateyLastPathUpdate `"$(Get-Date -UFormat %c)`" | Out-Null
} catch {
Write-Warning "Failure attempting to let Explorer know about updated environment settings.`n $($_.Exception.Message)"
}
Update-SessionEnvironment
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQM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jAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMxWjAjBgkqhkiG9w0BCQQxFgQUp1IUVv25lu5zKhi7
# 93d60AJ9YO8wDQYJKoZIhvcNAQEBBQAEggEAmXQRLM0A4LqhHB7+rcDerDygDYz6
# UQN5ip39sT5Nmqy0l8kj3iRT8SvSNWvp+95nO/ZQQnPS232liZc96DJzXAGKSU0O
# 9Ljn6DqDg6fr+w7Tpru5QY94gQYDWDjaAw6BIpQigcuVa+Rsyy/4SMnj2pe+bbhB
# S7ZinQ/EU7JI8K+B6uxR98/X6Ir8aijVbqBZfu7FKPI6hvQ+WUitFdBaLgmhJxKv
# 57fTE8zI2AiQSsyIDPg3zl9atjtDEyZlTywFNUlsk2FoMiy0SP4nzhXQZHq329P0
# PgVEAOo4w7W0FuG57Vnup18AdiV70pg0ccmk08wlVJHQtJ598Lff5111Yw==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2011 - 2017 RealDimensions Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Function Set-PowerShellExitCode {
<#
.SYNOPSIS
Sets the exit code for the PowerShell scripts.
.DESCRIPTION
Sets the exit code as an environment variable that is checked and used
as the exit code for the package at the end of the package script.
.NOTES
This tells PowerShell that it should prepare to shut down.
.INPUTS
None
.OUTPUTS
None
.PARAMETER ExitCode
The exit code to set.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Set-PowerShellExitCode 3010
#>
param (
[parameter(Mandatory=$false, Position=0)][int] $exitCode,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
# Do not log function call - can mess things up
if ($exitCode -eq $null -or $exitCode -eq '') {
Write-Debug '$exitCode was passed null'
return
}
try {
$host.SetShouldExit($exitCode);
} catch {
Write-Warning "Unable to set host exit code"
}
$env:ChocolateyExitCode = $exitCode;
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBk44m+QAHP2A4N
# KnbfCIFLvAkXmwOl+0zE8BdJ8ZyZTKCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj6Ygs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NU41g5qtNE+0OBYoYLTzeEYAC9cQgyH5D6GCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMxWjAjBgkqhkiG9w0BCQQxFgQUgqM3KR+Zoj2a1XZr
# F3aGT+MFOrwwDQYJKoZIhvcNAQEBBQAEggEAiSkUxfd4l+zw4hgwFX6nRNkjACF4
# /juncs+buORrVCgMgy0XOiNue/KXwtpp9yzEnSEq3Ys7/azb9Kxo7p2zi9jaZB6g
# RUV1LmkogOnNJ8YpqSb82LNyi+NDdKVyWeIgu/ziRY/eXHPaWGrKlzlCMvkXoMRQ
# mQYwTpw5og6P4/MUojrT6dsYGBdo6MVr307cxu1KL6ThCqQ0z0DdnY9wSWMc3zpN
# 5NTs9yTNg7uBCWkNJeB+ZalE7MQWEKvkETaqmmU9AWgs4BEh9BHgrt15l9N1iXnK
# cQQc+pUZBvpEvEX+9M8gnsrD2zdcwKXs/CGAcQdvzUDWuZ/2mYPgpG/zjg==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Start-ChocolateyProcessAsAdmin {
<#
.SYNOPSIS
**NOTE:** Administrative Access Required.
Runs a process with administrative privileges. If `-ExeToRun` is not
specified, it is run with PowerShell.
.NOTES
This command will assert UAC/Admin privileges on the machine.
Starting in 0.9.10, will automatically call Set-PowerShellExitCode to
set the package exit code in the following ways:
- 4 if the binary turns out to be a text file.
- The same exit code returned from the process that is run. If a 3010 is returned, it will set 3010 for the package.
Aliases `Start-ChocolateyProcess` and `Invoke-ChocolateyProcess`
available in 0.10.2+.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Statements
Arguments to pass to `ExeToRun` or the PowerShell script block to be
run.
.PARAMETER ExeToRun
The executable/application/installer to run. Defaults to `'powershell'`.
.PARAMETER Elevated
Indicate whether the process should run elevated.
Available in 0.10.2+.
.PARAMETER Minimized
Switch indicating if a Windows pops up (if not called with a silent
argument) that it should be minimized.
.PARAMETER NoSleep
Used only when calling PowerShell - indicates the window that is opened
should return instantly when it is complete.
.PARAMETER ValidExitCodes
Array of exit codes indicating success. Defaults to `@(0)`.
.PARAMETER WorkingDirectory
The working directory for the running process. Defaults to
`Get-Location`.
Available in 0.10.1+.
.PARAMETER SensitiveStatements
Arguments to pass to `ExeToRun` that are not logged.
Note that only licensed versions of Chocolatey provide a way to pass
those values completely through without having them in the install
script or on the system in some way.
Available in 0.10.1+.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Start-ChocolateyProcessAsAdmin -Statements "$msiArgs" -ExeToRun 'msiexec'
.EXAMPLE
Start-ChocolateyProcessAsAdmin -Statements "$silentArgs" -ExeToRun $file
.EXAMPLE
Start-ChocolateyProcessAsAdmin -Statements "$silentArgs" -ExeToRun $file -ValidExitCodes @(0,21)
.EXAMPLE
>
# Run PowerShell statements
$psFile = Join-Path "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" 'someInstall.ps1'
Start-ChocolateyProcessAsAdmin "& `'$psFile`'"
.EXAMPLE
# This also works for cmd and is required if you have any spaces in the paths within your command
$appPath = "$env:ProgramFiles\myapp"
$cmdBatch = "/c `"$appPath\bin\installmyappservice.bat`""
Start-ChocolateyProcessAsAdmin $cmdBatch cmd
# or more explicitly
Start-ChocolateyProcessAsAdmin -Statements $cmdBatch -ExeToRun "cmd.exe"
.LINK
Install-ChocolateyPackage
.LINK
Install-ChocolateyInstallPackage
#>
param(
[parameter(Mandatory=$false, Position=0)][string[]] $statements,
[parameter(Mandatory=$false, Position=1)][string] $exeToRun = 'powershell',
[parameter(Mandatory=$false)][switch] $elevated = $true,
[parameter(Mandatory=$false)][switch] $minimized,
[parameter(Mandatory=$false)][switch] $noSleep,
[parameter(Mandatory=$false)] $validExitCodes = @(0),
[parameter(Mandatory=$false)][string] $workingDirectory = $(Get-Location),
[parameter(Mandatory=$false)][string] $sensitiveStatements = '',
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
[string]$statements = $statements -join ' '
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$alreadyElevated = $false
if (Test-ProcessAdminRights) {
$alreadyElevated = $true
}
$dbMessagePrepend = "Elevating permissions and running"
if (!$elevated) {
$dbMessagePrepend = "Running"
}
try {
if ($exeToRun -ne $null) { $exeToRun = $exeToRun -replace "`0", "" }
if ($statements -ne $null) { $statements = $statements -replace "`0", "" }
} catch {
Write-Debug "Removing null characters resulted in an error - $($_.Exception.Message)"
}
if ($exeToRun -ne $null) {
$exeToRun = $exeToRun.Trim().Trim("'").Trim('"')
}
$wrappedStatements = $statements
if ($wrappedStatements -eq $null) { $wrappedStatements = ''}
if ($exeToRun -eq 'powershell') {
$exeToRun = "$($env:SystemRoot)\System32\WindowsPowerShell\v1.0\powershell.exe"
$importChocolateyHelpers = "& import-module -name '$helpersPath\chocolateyInstaller.psm1' -Verbose:`$false | Out-Null;"
$block = @"
`$noSleep = `$$noSleep
#`$env:ChocolateyEnvironmentDebug='false'
#`$env:ChocolateyEnvironmentVerbose='false'
$importChocolateyHelpers
try{
`$progressPreference="SilentlyContinue"
$statements
if(!`$noSleep){start-sleep 6}
}
catch{
if(!`$noSleep){start-sleep 8}
throw
}
"@
$encoded = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($block))
$wrappedStatements = "-NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat Text -OutputFormat Text -EncodedCommand $encoded"
$dbgMessage = @"
$dbMessagePrepend powershell block:
$block
This may take a while, depending on the statements.
"@
}
else
{
$dbgMessage = @"
$dbMessagePrepend [`"$exeToRun`" $wrappedStatements]. This may take a while, depending on the statements.
"@
}
Write-Debug $dbgMessage
$exeIsTextFile = [System.IO.Path]::GetFullPath($exeToRun) + ".istext"
if ([System.IO.File]::Exists($exeIsTextFile)) {
Set-PowerShellExitCode 4
throw "The file was a text file but is attempting to be run as an executable - '$exeToRun'"
}
if ($exeToRun -eq 'msiexec' -or $exeToRun -eq 'msiexec.exe') {
$exeToRun = "$($env:SystemRoot)\System32\msiexec.exe"
}
if (!([System.IO.File]::Exists($exeToRun)) -and $exeToRun -notmatch 'msiexec') {
Write-Warning "May not be able to find '$exeToRun'. Please use full path for executables."
# until we have search paths enabled, let's just pass a warning
#Set-PowerShellExitCode 2
#throw "Could not find '$exeToRun'"
}
# Redirecting output slows things down a bit.
$writeOutput = {
if ($EventArgs.Data -ne $null) {
Write-Verbose "$($EventArgs.Data)"
}
}
$writeError = {
if ($EventArgs.Data -ne $null) {
Write-Error "$($EventArgs.Data)"
}
}
$process = New-Object System.Diagnostics.Process
$process.EnableRaisingEvents = $true
Register-ObjectEvent -InputObject $process -SourceIdentifier "LogOutput_ChocolateyProc" -EventName OutputDataReceived -Action $writeOutput | Out-Null
Register-ObjectEvent -InputObject $process -SourceIdentifier "LogErrors_ChocolateyProc" -EventName ErrorDataReceived -Action $writeError | Out-Null
#$process.StartInfo = New-Object System.Diagnostics.ProcessStartInfo($exeToRun, $wrappedStatements)
# in case empty args makes a difference, try to be compatible with the older
# version
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName = $exeToRun
if ($wrappedStatements -ne '') {
$psi.Arguments = "$wrappedStatements"
}
if ($sensitiveStatements -ne $null -and $sensitiveStatements -ne '') {
Write-Host "Sensitive arguments have been passed. Adding to arguments."
$psi.Arguments += " $sensitiveStatements"
}
$process.StartInfo = $psi
# process start info
$process.StartInfo.RedirectStandardOutput = $true
$process.StartInfo.RedirectStandardError = $true
$process.StartInfo.UseShellExecute = $false
$process.StartInfo.WorkingDirectory = $workingDirectory
if ($elevated -and -not $alreadyElevated -and [Environment]::OSVersion.Version -ge (New-Object 'Version' 6,0)){
# this doesn't actually currently work - because we are not running under shell execute
Write-Debug "Setting RunAs for elevation"
$process.StartInfo.Verb = "RunAs"
}
if ($minimized) {
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Minimized
}
$process.Start() | Out-Null
if ($process.StartInfo.RedirectStandardOutput) { $process.BeginOutputReadLine() }
if ($process.StartInfo.RedirectStandardError) { $process.BeginErrorReadLine() }
$process.WaitForExit()
# For some reason this forces the jobs to finish and waits for
# them to do so. Without this it never finishes.
Unregister-Event -SourceIdentifier "LogOutput_ChocolateyProc"
Unregister-Event -SourceIdentifier "LogErrors_ChocolateyProc"
# sometimes the process hasn't fully exited yet.
for ($loopCount=1; $loopCount -le 15; $loopCount++) {
if ($process.HasExited) { break; }
Write-Debug "Waiting for process to exit - $loopCount/15 seconds";
Start-Sleep 1;
}
$exitCode = $process.ExitCode
$process.Dispose()
Write-Debug "Command [`"$exeToRun`" $wrappedStatements] exited with `'$exitCode`'."
if ($validExitCodes -notcontains $exitCode) {
Set-PowerShellExitCode $exitCode
throw "Running [`"$exeToRun`" $wrappedStatements] was not successful. Exit code was '$exitCode'. See log for possible error messages."
} else {
$chocoSuccessCodes = @(0, 1605, 1614, 1641, 3010)
if ($chocoSuccessCodes -notcontains $exitCode) {
Write-Warning "Exit code '$exitCode' was considered valid by script, but not as a Chocolatey success code. Returning '0'."
$exitCode = 0
}
}
Write-Debug "Finishing '$($MyInvocation.InvocationName)'"
return $exitCode
}
Set-Alias Start-ChocolateyProcess Start-ChocolateyProcessAsAdmin
Set-Alias Invoke-ChocolateyProcess Start-ChocolateyProcessAsAdmin
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBeJrjsyzloWo90
# bPem/YeoKb2sdri31BYOUhEdfDX1maCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj6YgsIJWuHEqH
# CN8M9eJNYBi+qsS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Oag8SF7x9I/G9aGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMxWjAjBgkqhkiG9w0BCQQxFgQUIycJh0rxlqSYahOn
# 50uUAdo9JPwwDQYJKoZIhvcNAQEBBQAEggEAJLTZO4E1lUKjXFFNFdP/2YbCirkh
# DRnzdr5DmYgFwJpK8zaGLM4OyeD77xkW7PRHhvxaDxn+WfEPTH9Gb305QpbnqhtH
# SCDJ2e7LePyMZaugFvRQEYoWcUWRrGmLY2stbZy4/3PTXoxbzRgecsCQMw2fC56u
# rdkI/bWMJDtMdVA5Z+TLyKuGZFFKgJIjH+dXFfLGc8npabsA6FK1GCGLsHk9YR0/
# QtUdn07Q8Yv2qjx+kndOMu8J/+MWv5PmRpwp8jKbjIdyj4mhxDrH8C8mBMBjTeel
# 7/82FvUfACArG1mJNGNn8l25nHI6r0NjodiHIHX2GX69ugls915ZUCWvyQ==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Test-ProcessAdminRights {
<#
.SYNOPSIS
Tests whether the current process is running with administrative rights.
.DESCRIPTION
This function checks whether the current process has administrative
rights by checking if the current user identity is a member of the
Administrators group. It returns `$true` if the current process is
running with administrative rights, `$false` otherwise.
On Windows Vista and later, with UAC enabled, the returned value
represents the actual rights available to the process, e.g. if it
returns `$true`, the process is running elevated.
.INPUTS
None
.OUTPUTS
System.Boolean
#>
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent([Security.Principal.TokenAccessLevels]'Query,Duplicate'))
$isAdmin = $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
Write-Debug "Test-ProcessAdminRights: returning $isAdmin"
return $isAdmin
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBNvrYvnWyvQT/3
# irxUpi1gcgNmCSeSBStWZn2SrMMjc6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ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sI
# gjRYKvEGs6jjIp+nxe6OAyfOSjooAVZO9nvAyddfeLa7PyTaMqem8isZz4fTGf7Q
# 5tYt77snucVVK33RiJBudBthHtzqKVOuMDAb/4XLRUIgMs8r4Lh+KDldJCsWqAgM
# L8oavyXGsll5Aww44m7g4L6mFsRl6trpJlu5kI9WxL+BUUIUyC4oykVfFx4j4Bew
# uqIBpPZdvSX9+0kxIfDaYGrWspou8S3fIei6pakN5JPJXau+k0LBn6GCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMxWjAjBgkqhkiG9w0BCQQxFgQUD9h/aXQdQ7R4hwQ8
# 38C10Ch+tbMwDQYJKoZIhvcNAQEBBQAEggEAe0eGND1A3bNM4O9v/rHnXXrXgF2v
# YiHBUMOsIcRYo9wG2nbgK4/GvRh5hs7gGzEphOo6DxPnbRKVMTrSGeyOeqiMoTVZ
# VN6ANh/2Zvwc2QLxULdG+5se6LpHujFh718cWKqLs9sSZQBTAbuDX/OkHegU79dN
# x/U0mi5w3GbOC6jhO7IO+msbhIZU9POwDevcezmUrgsA3YZJsryw4ngD6MYaG2Ue
# 45RrzKslvSWIUNne5w9g64sBTk4HK/FDL5lA+gqY4pHMr+ws8ZVhHpab9W6rX9PX
# O64L1/9uG6f/Yhwm4JZghNKFXk/m4/02SCHk9UPXoOsuVbJTTed6t6F63g==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Uninstall-BinFile {
<#
.SYNOPSIS
Removes a shim (or batch redirect) for a file.
.DESCRIPTION
Chocolatey installs have the folder `$($env:ChocolateyInstall)\bin`
included in the PATH environment variable. Chocolatey automatically
shims executables in package folders that are not explicitly ignored,
putting them into the bin folder (and subsequently onto the PATH).
When you have other files you have shimmed, you need to use this
function to remove them from the bin folder.
.NOTES
Not normally needed for exe files in the package folder, those are
automatically discovered and the shims removed.
.INPUTS
None
.OUTPUTS
None
.PARAMETER Name
The name of the redirect file without ".exe" appended to it.
.PARAMETER Path
The path to the original file. Can be relative from
`$($env:ChocolateyInstall)\bin` back to your file or a full path to the
file.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.LINK
Install-BinFile
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $name,
[parameter(Mandatory=$false, Position=1)][string] $path,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$nugetPath = [System.IO.Path]::GetFullPath((Join-Path "$helpersPath" '..\'))
$nugetExePath = Join-Path "$nugetPath" 'bin'
$packageBatchFileName = Join-Path $nugetExePath "$name.bat"
$packageBashFileName = Join-Path $nugetExePath "$name"
$packageShimFileName = Join-Path $nugetExePath "$name.exe"
$path = $path.ToLower().Replace($nugetPath.ToLower(), "%DIR%..\").Replace("\\","\")
$pathBash = $path.Replace("%DIR%..\","`$DIR/../").Replace("\","/")
Write-Debug "Attempting to remove the batch and bash shortcuts: $packageBatchFileName and $packageBashFileName"
if (Test-Path $packageBatchFileName) {
Write-Host "Removing batch file $packageBatchFileName which pointed to `'$path`'."
Remove-Item $packageBatchFileName
}
else {
Write-Debug "Tried to remove batch file $packageBatchFileName but it was already removed."
}
if (Test-Path $packageBashFileName) {
Write-Host "Removing bash file $packageBashFileName which pointed to `'$path`'."
Remove-Item $packageBashFileName
}
else {
Write-Debug "Tried to remove bash file $packageBashFileName but it was already removed."
}
Write-Debug "Attempting to remove the shim: $packageShimFileName"
if (Test-Path $packageShimFileName) {
Write-Host "Removing shim $packageShimFileName which pointed to `'$path`'."
Remove-Item $packageShimFileName
}
else {
Write-Debug "Tried to remove shim $packageShimFileName but it was already removed."
}
}
Set-Alias Remove-BinFile Uninstall-BinFile
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBxi4FKQtlaRtI/
# ByhSS+Td1sx5hLEwyyR/6cl8nmoz1KCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25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COnsRdZJVNhsfRpZfzfAIS5lKN434T4AAnf08XbytzXmoirTg5+u9QqffbkJ5o8A
# wyp0VD5d9AKFWmH2ZOvdHH3Jflf2Z8ZHJcl43r9ZeGuhuynB0e0R1gGVy86qGVYq
# V8XjKiKRUVE1dKHX3vHOMmY1qil7kZVVCWp+qRjrNRZ1UnZxv3i+ZjIXZUra+JT+
# 97atootTgN4XZxnZHf1JXLeHo1Rl3K1D/5klr9BkK+KElyNKoknDLKGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMxWjAjBgkqhkiG9w0BCQQxFgQUlk+AH0M9/hr2bc5m
# 8VjKFLksYs0wDQYJKoZIhvcNAQEBBQAEggEACbJMFbRDGPlOXj4rv8P0kiow7jrt
# uVKbjgbl/iIzSg1WRwL6sgyGpUEAWTYEyy8FZop1AY13idr9f2czvGHZ8n5GBUSv
# ICxKw1/9kV840ntusqGuStOZU0F4q5Aew7FY22NsXEpodZ/eG9PzdoblBQXBY/f9
# jdirw1CKdHII8vv+jD2Qt/+gIuyk1Qs3zShwImyd/uYqsHs3Xsjo6w/ne/WlAl8t
# 9SZCmMsjZKUVG56yKwyzoSAk1CKVUOZjf4+CbGLP8KHdHPT7gtnEgsya6iN/lIFJ
# 2kW12rWdLTEO2VeD9V4N3LtPFv0O9JGXJOKtGZldMBSdcEr2fLmfyYOy3Q==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2011 - 2017 RealDimensions Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Uninstall-ChocolateyEnvironmentVariable {
<#
.SYNOPSIS
**NOTE:** Administrative Access Required when `-VariableType 'Machine'.`
Removes a persistent environment variable.
.DESCRIPTION
Uninstall-ChocolateyEnvironmentVariable removes an environment variable
with the specified name and value. The variable can be scoped either to
the User or to the Machine. If Machine level scoping is specified, the
command is elevated to an administrative session.
.NOTES
Available in 0.9.10+. If you need compatibility with older versions,
use Install-ChocolateyEnvironmentVariable and set `-VariableValue $null`
This command will assert UAC/Admin privileges on the machine when
`-VariableType Machine`.
This will remove the environment variable from the current session.
.INPUTS
None
.OUTPUTS
None
.PARAMETER VariableName
The name or key of the environment variable to remove.
.PARAMETER VariableType
Specifies whether this variable is at either the individual User level
or at the Machine level.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
>
# Remove an environment variable
Uninstall-ChocolateyEnvironmentVariable -VariableName 'bob'
.EXAMPLE
>
# Remove an environment variable from Machine
Uninstall-ChocolateyEnvironmentVariable -VariableName 'bob' -VariableType 'Machine'
.LINK
Install-ChocolateyEnvironmentVariable
.LINK
Set-EnvironmentVariable
.LINK
Install-ChocolateyPath
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $variableName,
[parameter(Mandatory=$false, Position=1)]
[System.EnvironmentVariableTarget] $variableType = [System.EnvironmentVariableTarget]::User,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
if ($variableType -eq [System.EnvironmentVariableTarget]::Machine) {
if (Test-ProcessAdminRights) {
Set-EnvironmentVariable -Name $variableName -Value $null -Scope $variableType
} else {
$psArgs = "Install-ChocolateyEnvironmentVariable -variableName `'$variableName`' -variableValue $null -variableType `'$variableType`'"
Start-ChocolateyProcessAsAdmin "$psArgs"
}
} else {
Set-EnvironmentVariable -Name $variableName -Value $null -Scope $variableType
}
Set-Content env:\$variableName $null
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDNjny7BMzeJ1uB
# 8j7qaro2ZoUNL0UkP4S8UuZl+Hsu3KCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj6YgsIJWuHEqH
# CN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zLmuATs/d3NNsux4L61uKGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMyWjAjBgkqhkiG9w0BCQQxFgQULwTHWqZuo1oWrC2H
# i9LDqNwwu7wwDQYJKoZIhvcNAQEBBQAEggEABayBpez3AS1TjW5I7gIYhAcGM+Hh
# q46AGSjr5zNuGepp0ShbgM89E9Y7payyLWz5nhOZahbGy7XRfXeazRmOPVtfjTr0
# iA0rOdXy3GFPT1vro5WRVGPoiOng2kUjrL0n6y8+wRgixgUjfICbYXZ7v2Z2fes5
# PZ5vjbTRpxHcQgpb0jB2p4A3gx6rtrEqFpc6K+QHVnOS2gb+Sx6KHBdaOPXw6vyB
# 2+5YDqDrDA7tQJR1rsSrJTWlr52AbVYv/Pozy3bS2j/ZsAd9K3QkB5geGdnK39h9
# oFh0KFTS2ga2Ra1AJT+Xo+Xaa20z5OkenJUtfubAkWJlx8vwP/CHreZYWg==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Uninstall-ChocolateyPackage {
<#
.SYNOPSIS
Uninstalls software from "Programs and Features".
.DESCRIPTION
This will uninstall software from your machine (in Programs and
Features). This may not be necessary if Auto Uninstaller is turned on.
Choco 0.9.9+ automatically tracks registry changes for "Programs and
Features" of the underlying software's native installers when
installing packages. The "Automatic Uninstaller" (auto uninstaller)
service is a feature that can use that information to automatically
determine how to uninstall these natively installed applications. This
means that a package may not need an explicit chocolateyUninstall.ps1
to reverse the installation done in the install script.
With auto uninstaller turned off, a chocolateyUninstall.ps1 is required
to perform uninstall from "Programs and Features". In the absence of
chocolateyUninstall.ps1, choco uninstall only removes the package from
Chocolatey but does not remove the sofware from your system without
auto uninstaller.
.NOTES
May not be required. Starting in 0.9.10+, the Automatic Uninstaller
(AutoUninstaller) is turned on by default.
.INPUTS
None
.OUTPUTS
None
.PARAMETER PackageName
The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.
.PARAMETER FileType
This is the extension of the file. This should be either exe or msi.
If what is provided is empty or null, Chocolatey will use 'exe'
starting in 0.10.1.
.PARAMETER SilentArgs
OPTIONAL - These are the parameters to pass to the native uninstaller,
including any arguments to make the uninstaller silent/unattended.
Licensed editions of Chocolatey will automatically determine the
installer type and merge the arguments with what is provided here.
Try any of the to get the silent (unattended) uninstaller -
`/s /S /q /Q /quiet /silent /SILENT /VERYSILENT`. With msi it is always
`/quiet`. Please pass it in still but it will be overridden by
Chocolatey to `/quiet`. If you don't pass anything it could invoke the
installer with out any arguments. That means a nonsilent installer.
Please include the `notSilent` tag in your Chocolatey package if you
are not setting up a silent/unattended package. Please note that if you
are submitting to the community repository, it is nearly a requirement
for the package to be completely unattended.
.PARAMETER File
The full path to the native uninstaller to run.
.PARAMETER ValidExitCodes
Array of exit codes indicating success. Defaults to `@(0)`.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Uninstall-ChocolateyPackage '__NAME__' 'EXE_OR_MSI' 'SILENT_ARGS' 'FilePath'
.EXAMPLE
>
Uninstall-ChocolateyPackage -PackageName $packageName `
-FileType $installerType `
-SilentArgs "$silentArgs" `
-ValidExitCodes $validExitCodes `
-File "$file"
.LINK
Install-ChocolateyPackage
.LINK
Install-ChocolateyInstallPackage
.LINK
Uninstall-ChocolateyZipPackage
.LINK
Get-UninstallRegistryKey
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $packageName,
[parameter(Mandatory=$false, Position=1)]
[alias("installerType")][string] $fileType = 'exe',
[parameter(Mandatory=$false, Position=2)][string[]] $silentArgs = '',
[parameter(Mandatory=$false, Position=3)][string] $file,
[parameter(Mandatory=$false)] $validExitCodes = @(0),
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
[string]$silentArgs = $silentArgs -join ' '
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$installMessage = "Uninstalling $packageName..."
write-host $installMessage
$additionalInstallArgs = $env:chocolateyInstallArguments;
if ($additionalInstallArgs -eq $null) { $additionalInstallArgs = ''; }
$overrideArguments = $env:chocolateyInstallOverride;
if ($fileType -eq $null) { $fileType = '' }
$installerTypeLower = $fileType.ToLower()
if ($installerTypeLower -ne 'msi' -and $installerTypeLower -ne 'exe') {
Write-Warning "FileType '$fileType' is unrecognized, using 'exe' instead."
$fileType = 'exe'
}
if ($fileType -like 'msi') {
$msiArgs = "/x"
if ($overrideArguments) {
$msiArgs = "$msiArgs $additionalInstallArgs";
write-host "Overriding package arguments with `'$additionalInstallArgs`'";
} else {
$msiArgs = "$msiArgs $silentArgs $additionalInstallArgs";
}
Start-ChocolateyProcessAsAdmin "$msiArgs" "$($env:SystemRoot)\System32\msiexec.exe" -validExitCodes $validExitCodes
}
if ($fileType -like 'exe') {
if ($overrideArguments) {
Write-Host "Overriding package arguments with `'$additionalInstallArgs`'";
Start-ChocolateyProcessAsAdmin "$additionalInstallArgs" $file -validExitCodes $validExitCodes
} else {
Start-ChocolateyProcessAsAdmin "$silentArgs $additionalInstallArgs" $file -validExitCodes $validExitCodes
}
}
Write-Host "$packageName has been uninstalled."
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAbZyQFA95OGRHB
# cD9tP19AkE1qUrhGx5KAnPXf+jwEJ6CCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj6YgsIJWuHEqH
# CN8M9eJNYBi+qsSyrnAxZjNxPqxwoqvOf+l8y5Kh5TsxHM/q8grkV7tKtel05iv+
# bMt+dDk2DZDv5LVOpKnqagqrhPOsZ061xPeM0SAlI+sIZD5SlsHy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TAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDMyWjAjBgkqhkiG9w0BCQQxFgQU7vpWQ4JOliS3+ZMH
# vu/It150P9AwDQYJKoZIhvcNAQEBBQAEggEAH++50ccGcnIwhEPm43NWKQ0DVxJa
# qtYSq2Oq4vicVlgsqO0bc+WgdSiqsNExOPQMRv7NGiHhAx5Ut4iYarHKzOu8cLfo
# pmKXoZ61w/wPFT6l3kyc9umYQ0dFK0toIz2ShoiTZVQ3aqC7W5isVySiUklTWuDG
# bFJKZMpfBBXJW6s9GxlJ4IntJSXbgrLw2o8lYfaLL8nD7EejTpUzM6xn51JusU3r
# KypUE5b8sstg1xMQW7/FjIw4MyCsUUdLHu75YWbUrN3uU5S1mhEjS7DRagIcQFVY
# sDu5FECIwc559d18rg65agHivAyfah/I7oMkN6doQ2afNu3rtyCpwwUb5w==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Uninstall-ChocolateyZipPackage {
<#
.SYNOPSIS
Uninstalls a previous installed zip package, may not be necessary.
.DESCRIPTION
This will uninstall a zip file if installed via Install-ChocolateyZipPackage.
This is not necessary if the files are unzipped to the package directory.
.NOTES
Not necessary if files are unzippped to package directory.
This helper reduces the number of lines one would have to remove the
files extracted from a previously installed zip file.
This method has error handling built into it.
.INPUTS
None
.OUTPUTS
None
.PARAMETER PackageName
The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.
.PARAMETER ZipFileName
This is the zip filename originally installed.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.EXAMPLE
Uninstall-ChocolateyZipPackage '__NAME__' 'filename.zip'
.LINK
Install-ChocolateyZipPackage
.LINK
Uninstall-ChocolateyPackage
#>
param(
[parameter(Mandatory=$true, Position=0)][string] $packageName,
[parameter(Mandatory=$true, Position=1)][string] $zipFileName,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$packagelibPath=$env:chocolateyPackageFolder
$zipContentFile=(join-path $packagelibPath $zipFileName) + ".txt"
if ((Test-Path -path $zipContentFile)) {
$zipContentFile
$zipContents=get-content $zipContentFile
foreach ($fileInZip in $zipContents) {
if ($fileInZip -ne $null -and $fileInZip.Trim() -ne '') {
Remove-Item -Path "$fileInZip" -ErrorAction SilentlyContinue -Recurse -Force
}
}
}
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAk6WW/GT/B7DPm
# mdYeFsBLHrJbzvRl5OqZtt38MRIOlqCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20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QzZDyGkNRtsxi6Hsh9H5YIIDDTe8EkzCVfDTndTlcIuo/XG
# ZBFO+LB+OX7OwRJSGtsQElw9W8wFC24INtvaAGycM+M/Qevsk4rq7DsOh9xMvAji
# JQV2kMYQLn7gors4jfYC/qnpEBsfWRvZ35tqlRHx+V60iaDL/BFDOwLXaA==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Update-SessionEnvironment {
<#
.SYNOPSIS
Updates the environment variables of the current powershell session with
any environment variable changes that may have occured during a
Chocolatey package install.
.DESCRIPTION
When Chocolatey installs a package, the package author may add or change
certain environment variables that will affect how the application runs
or how it is accessed. Often, these changes are not visible to the
current PowerShell session. This means the user needs to open a new
PowerShell session before these settings take effect which can render
the installed application nonfunctional until that time.
Use the Update-SessionEnvironment command to refresh the current
PowerShell session with all environment settings possibly performed by
Chocolatey package installs.
.NOTES
This method is also added to the user's PowerShell profile as
`refreshenv`. When called as `refreshenv`, the method will provide
additional output.
Preserves `PSModulePath` as set by the process starting in 0.9.10.
.INPUTS
None
.OUTPUTS
None
#>
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$refreshEnv = $false
$invocation = $MyInvocation
if ($invocation.InvocationName -eq 'refreshenv') {
$refreshEnv = $true
}
if ($refreshEnv) {
Write-Output "Refreshing environment variables from the registry for powershell.exe. Please wait..."
} else {
Write-Verbose "Refreshing environment variables from the registry."
}
$userName = $env:USERNAME
$architecture = $env:PROCESSOR_ARCHITECTURE
$psModulePath = $env:PSModulePath
#ordering is important here, $user comes after so we can override $machine
'Process', 'Machine', 'User' |
% {
$scope = $_
Get-EnvironmentVariableNames -Scope $scope |
% {
Set-Item "Env:$($_)" -Value (Get-EnvironmentVariable -Scope $scope -Name $_)
}
}
#Path gets special treatment b/c it munges the two together
$paths = 'Machine', 'User' |
% {
(Get-EnvironmentVariable -Name 'PATH' -Scope $_) -split ';'
} |
Select -Unique
$Env:PATH = $paths -join ';'
# PSModulePath is almost always updated by process, so we want to preserve it.
$env:PSModulePath = $psModulePath
# reset user and architecture
if ($userName) { $env:USERNAME = $userName; }
if ($architecture) { $env:PROCESSOR_ARCHITECTURE = $architecture; }
if ($refreshEnv) {
Write-Output "Finished"
}
}
Set-Alias refreshenv Update-SessionEnvironment
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCL+pVj35SUMM5K
# ZOZ/v+pTFxqKwmbwUPo2rRttrIrGbqCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIg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right © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Write-ChocolateyFailure {
<#
.SYNOPSIS
DEPRECATED - DO NOT USE.
.DESCRIPTION
Throws the error message as an error.
.NOTES
This has been deprecated and is no longer useful as of 0.9.9. Instead
please just use `throw $_.Exception` when catching errors. Although
try/catch is no longer necessary unless you want to do some error
handling.
.INPUTS
None
.OUTPUTS
None
.PARAMETER PackageName
The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.
.PARAMETER FailureMessage
The message to throw an error with.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.LINK
Write-ChocolateySuccess
#>
param(
[string] $packageName,
[string] $failureMessage,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
Write-Warning "Write-ChocolateyFailure is deprecated and will be removed in v2. If you are the package maintainer, please use 'throw `$_.Exception' instead."
$error | %{ $_.Exception | fl * | Out-String }
throw "$failureMessage"
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA3Qn1zAetWAwLq
# I1m1I1XXPWaYjpUoK/2sIfQrsYPZHaCCF7EwggUwMIIEGKADAgECAhAECRgb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fnKk9vZZkrt4N0UgFEvEFU/hOL0W8Fc3RfUlhd30EQLhOsXrxBJWdopCBw
# 5oPFZpWVsEJ9nbc5nppiTOAgr2C54SdUmLEiRq3J/+flLC8lvvEboNEbKmyjvKAQ
# Y9iPQoVvI+ewU8ywyX1Wbylumc2SA8F7bUW9v4mPCinVCs00wNPp73KWRZ2kPjJk
# asvvd5Cd60J18wH86Hju1No1wuv6ONAlZWd3qr3WDs6fWY1ARZOp7omjF1SMNN3d
# VNXmH0Y2k4/YG1sknTvTGKRHW3Ax1CULnrwqps6nY3tEG/1fSKtzbUzS+g==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Write-ChocolateySuccess {
<#
.SYNOPSIS
DEPRECATED - DO NOT USE.
.DESCRIPTION
Writes a success message for a package.
.NOTES
This has been deprecated and is no longer useful as of 0.9.9. Instead
please just use `throw $_.Exception` when catching errors. Although
try/catch is no longer necessary unless you want to do some error
handling.
.INPUTS
None
.OUTPUTS
None
.PARAMETER PackageName
The name of the package - while this is an arbitrary value, it's
recommended that it matches the package id.
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
.LINK
Write-ChocolateyFailure
#>
param(
[string] $packageName,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
Write-Warning "Write-ChocolateySuccess is deprecated and will be removed in v2. If you are the maintainer, please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TGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDM2WjAjBgkqhkiG9w0BCQQxFgQU00WFqDCrK7vOSfpl
# rofnYF6wjxwwDQYJKoZIhvcNAQEBBQAEggEAW1JNk6cUSjuVMybnuF+hEgVTQXoB
# waKvcEO1EYiJhIEUhehnRNndNYp7XEg6lTzAW1k9zWA3TmZ3R0HdoP95AD5oQciv
# TvfQfaXc7LAnfYoJL8kpkLtQS5/hhNZyPLzCbsTwq5QzVD2iGmsCiID6JTvHh+dP
# Q6Vt0MdqObsJI4LTnya4uzdDunkRNSOFdm/uUCAq5Hgy3EC2mniYAJtp2cVkSbEy
# JDjg+a6Gkksxcvvuoo6aTCVhhkS5DtqjvyXhhWmrKEt29o/nQ5s7j4L2sNb3fYT8
# Hoh6fxZCOUTrRqu2G6jZgr/THNd1WOKrxAbp3D8dfOOkm+knpYY0U+4wQg==
# SIG # End signature block
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
function Write-FileUpdateLog {
<#
.SYNOPSIS
DEPRECATED - DO NOT USE. Will be removed in v1.
.DESCRIPTION
Monitors a location and writes changes to a log file.
.NOTES
DEPRECATED.
Has issues with paths longer than 260 characters. See
https://github.com/chocolatey/choco/issues/156
.INPUTS
None
.OUTPUTS
None
.PARAMETER LogFilePath
The full path to where to write the log file.
.PARAMETER LocationToMonitor
The location to watch for changes at.
.PARAMETER ScriptToRun
The script block of what to run and monitor changes.
.PARAMETER ArgumentList
.PARAMETER IgnoredArguments
Allows splatting with arguments that do not apply. Do not use directly.
#>
param (
[string] $logFilePath,
[string] $locationToMonitor,
[scriptblock] $scriptToRun,
[object[]] $argumentList,
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments
)
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
Write-Warning "Write-FileUpdateLog has been deprecated and will be removed in v1."
Write-Debug "Tracking current state of `'$locationToMonitor`'"
$originalContents = Get-ChildItem -Recurse $locationToMonitor | Select-Object LastWriteTimeUTC,FullName,Length
Invoke-Command -ScriptBlock $scriptToRun -ArgumentList $argumentList
$newContents = Get-ChildItem -Recurse $locationToMonitor | Select-Object LastWriteTimeUTC,FullName,Length
if($originalContents -eq $null) {$originalContents = @()}
if($newContents -eq $null) {$newContents = @()}
$changedFiles = Compare-Object $originalContents $newContents -Property LastWriteTimeUtc,FullName,Length -PassThru | Group-Object FullName
#log modified files
$changedFiles | ? {$_.Count -gt 1} | % {$_.Name} | Add-Content $logFilePath
#log added files
$addOrDelete = $changedFiles | ? { $_.Count -eq 1 } | % {$_.Group}
$addOrDelete | ? {$_.SideIndicator -eq "=>"} | % {$_.FullName} | Add-Content $logFilePath
#log deleted files
#$addOrDelete | ? {$_.SideIndicator -eq "<="} | % {$_.FullName} | Add-Content $logFilePath
}
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDWdJgxheIQdiL+
# r5sw1KGqVonUmLKMyOwS/ZnhNt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AEggEAW973ZPthR3eRM94aE0HUe41/yi9u
# 3VfSS1ZjzLitzCIr0Cq8PdcrCrrTpNRMEXODRCteq4MEkFmcgUVIk0X265wv9Mz+
# Z376PcANE8poniTEpcENNd3u9e985vBuIPDYcJQC6zdYrtvav+ioVn6/7XUk2IEl
# iztUrwei385zmLK0TEcDZsa7/oKmNWskWHShe8tTUbBv46gmaPfd8yEMVHfsttXo
# kxW9NqoPjk42jZ+fgRjvnLu9SYITVAklxzPDMT3A/fR6riJh+1eRPOPw5vQzt7oC
# QU44ERwcwhduSz8VE9C6eRT37GvwBHiS95jYn6ayUXEgUlLx5iSp+zGwhQ==
# SIG # End signature block
Copyright (c) 2017 Chocolatey Software, Inc.
Copyright (c) 2011 - 2017 RealDimensions Software, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
md5: AB74F9839D492380F9438F9EF3F6A663 | sha1: 685234049C2DA58B61382D336FB5312C1EC4B3A3 | sha256: 224321B57ECB6C8BD42C43D9D81B36C70878F055DD742BD11D7E6C7F7CCCA99D | sha512: 61BDED911C98B189643E26371D06E71595CE7F1F9B05E7656D4B03B14C17679AC26FD390E01AB990917BD80899E8E4AD4D16C474ED7C8702C5D65899B6049A60
md5: 60097BB30E1504CDC5A4F714CA2127B0 | sha1: B3AC2CB889427CA8515E0FFDFCC982A0AC3D5F6E | sha256: FDC70AEED54F076DC54A5DD2C4437606B1328C35C793F69B8213853300320370 | sha512: 16E3675CA9CFFE1DAE58A8C7CDB5C2AC0D6C332F1441E0371E5F3B1DFA052516B3A2607E9CEFEA771A51C0E65753EC4AB768FEFCF2010F37F51B6F198B2E0950
md5: B242E1F7EF0BA92199660EA55C2CA7A6 | sha1: 7613D81CF100C617F181D48B08D70880C589F85F | sha256: 007A39F295115118A3903AC6642A18ECFE3231D8282E4F53B577FBB60E8BEA62 | sha512: F141AB93EC172EDC6A9F4D3C9DB28FB66447E2FCDF0F88210F43140264B6B658FC3A5F9B624F0BE4BAD7725482C3CD48881BC9262EE2A48EC8AE2C8445B3698A
md5: 0421CEBAB0B3B118FE8B4F3587F58C0B | sha1: B110EF39375AA51A62EA9FA08ADFB66785815864 | sha256: 81DD2AD0E42E8303FED70DEC64039D0A87CD6A5A6B1EF787900BAFCC1BAD5E40 | sha512: 7707E3B5149DC852F1B870681CDEEC72CD04C27C3FBBCDC75505257F12018DEE3E855358520F30D3091EDD64A0A0E997169FF451119785608027223132BA980A
md5: BAF1C5BD0239D4C9E36F27FD7D28C384 | sha1: BF14568750F34D76B07A5FCFFEC981BE0BFA21FB | sha256: 5A2CE541F5B9ABFAF9838AAE4C9AEB3401DD6F6EF1FACEB05430A31F473C5A2F | sha512: C5B0E7CFD3CA97397F279ECCDC841EF411015B2CDCE7DEFB4393BDF167959D9343F3D76106DE05E71FD2767A1F4F0A559474A7E6DD2AB565105D49F935792390
md5: 9294C49F366CB8967CF91990AF257A9F | sha1: 52EA2612A1F29327E0D85E7A40E1936C0728D505 | sha256: 900CF5F4F4EFA8F41A6E89AC614C86EA4D91DC439B6B4CB6E381B22D2233586C | sha512: 9F50F8442EA0164E17860F5883E4F6439F946C111DD768C5F6691A1015B55AF230C9199478A3B9E7885167F0A7912571792C762AAE8805F87D4C85EE6D9D4B29
md5: AAB66FCAF086E38DA07D2668D5054F0C | sha1: D50DCF546DD83CE017876666E731CD6A00A0A7F4 | sha256: 358B1B70F7FBEA9790E89D96B93938534FBC0CC51415BA80078D7AC752383637 | sha512: 95F19218D18B3D58A631197E04E14A2B36C5556DE97160211E59DB2664786C3D2403CF49514424AF0F12F9AD9ED9572B37FD18021C2D07BC250AF2862D4360E2
md5: C554E4C4B3D811A2168BE3B04EF43847 | sha1: AFA08D0D2BB24DE618CE9139F4B889FEF77EBDA7 | sha256: C9E682BB2FB14F5036CB19431FA6FF6D84442E89FB229FB8E3F1E02E7C05BD7D | sha512: ECEF7016185477AD71FD597217BA9977F08A7DFEB404E0C390254919C3412C509E4B9695BD254F156081E21DEC6D478F95B40D2789218AE171634833943339AF
md5: D9B1AC1A5ED205F4760B986348FA6F92 | sha1: 964339BBE98C5ED52FD568C204E461133D386750 | sha256: 9769167B8C1EA32F73F9499F6F153D2C43F720FC34C345110E3144569109D535 | sha512: 23B243AAEAB7D0C458CE141B4F55BB788BEB082857CB2C59C53A61390A5BE25B3108B7F0D8104EA39A3C7C2E596949FF62ED2F0C8BDAB83497E1E88BC71336CA
@echo off
::
:: RefreshEnv.cmd
::
:: Batch file to read environment variables from registry and
:: set session variables to these values.
::
:: With this batch file, there should be no need to reload command
:: environment every time you want environment changes to propagate
::echo "RefreshEnv.cmd only works from cmd.exe, please install the Chocolatey Profile to take advantage of refreshenv from PowerShell"
echo | set /p dummy="Refreshing environment variables from registry for cmd.exe. Please wait..."
goto main
:: Set one environment variable from registry key
:SetFromReg
"%WinDir%\System32\Reg" QUERY "%~1" /v "%~2" > "%TEMP%\_envset.tmp" 2>NUL
for /f "usebackq skip=2 tokens=2,*" %%A IN ("%TEMP%\_envset.tmp") do (
echo/set "%~3=%%B"
)
goto :EOF
:: Get a list of environment variables from registry
:GetRegEnv
"%WinDir%\System32\Reg" QUERY "%~1" > "%TEMP%\_envget.tmp"
for /f "usebackq skip=2" %%A IN ("%TEMP%\_envget.tmp") do (
if /I not "%%~A"=="Path" (
call :SetFromReg "%~1" "%%~A" "%%~A"
)
)
goto :EOF
:main
echo/@echo off >"%TEMP%\_env.cmd"
:: Slowly generating final file
call :GetRegEnv "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" >> "%TEMP%\_env.cmd"
call :GetRegEnv "HKCU\Environment">>"%TEMP%\_env.cmd" >> "%TEMP%\_env.cmd"
:: Special handling for PATH - mix both User and System
call :SetFromReg "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" Path Path_HKLM >> "%TEMP%\_env.cmd"
call :SetFromReg "HKCU\Environment" Path Path_HKCU >> "%TEMP%\_env.cmd"
:: Caution: do not insert space-chars before >> redirection sign
echo/set "Path=%%Path_HKLM%%;%%Path_HKCU%%" >> "%TEMP%\_env.cmd"
:: Cleanup
del /f /q "%TEMP%\_envset.tmp" 2>nul
del /f /q "%TEMP%\_envget.tmp" 2>nul
:: capture user / architecture
SET "OriginalUserName=%USERNAME%"
SET "OriginalArchitecture=%PROCESSOR_ARCHITECTURE%"
:: Set these variables
call "%TEMP%\_env.cmd"
:: reset user / architecture
SET "USERNAME=%OriginalUserName%"
SET "PROCESSOR_ARCHITECTURE=%OriginalArchitecture%"
echo | set /p dummy="Finished."
echo .
md5: FFA8EFF0712BEA1D1576FE25AD66371D | sha1: BB0688D07703AC66538FC99688C3F43C5A345904 | sha256: 271B01107B1FEC5231409F8DB91463D7B9A9D482D782971A1C4B6C5D12629F12 | sha512: D3FED12839F0086335080F640A6DA3480FD267B368347FD2D904D02D3CAABD52ABB698541D488D401001B1628D6851609BCFC257CBD418253BFA4A06B3757311
md5: E7957B74BEFE1B2451C460B111C8E86F | sha1: 97F654A97989002EE1193D4BCA8CE0E47F016805 | sha256: 27A05F5C210DA07E1EDB7C0E6EB995B26B0164E8BFF38478ED12036D463B2B19 | sha512: 627AC61D84DE45F19668EFDE5825FADEF7AD4F393F058502B68CD179869527C66E1D7901B149FE0BE43C42505123977329402322AED0D8E0F5BF9D4E9945905D
7-Zip
~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7-Zip Copyright (C) 1999-2016 Igor Pavlov.
Licenses for files are:
1) 7z.dll: GNU LGPL + unRAR restriction
2) All other files: GNU LGPL
The GNU LGPL + unRAR restriction means that you must follow both
GNU LGPL rules and unRAR restriction rules.
Note:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.
GNU LGPL information
--------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/
unRAR restriction
-----------------
The decompression engine for RAR archives was developed using source
code of unRAR program.
All copyrights to original unRAR code are owned by Alexander Roshal.
The license for original unRAR code has the following restriction:
The unRAR sources cannot be used to re-create the RAR compression algorithm,
which is proprietary. Distribution of modified unRAR sources in separate form
or as a part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.
--
Igor Pavlov
md5: 0F124A5569BF24E26D20CD623F52CC54 | sha1: C8750EA7D8F387F7F1B2E04C22B6F0FCA9C8C080 | sha256: EB87B365251CD4C4E04B33CDAD87CEEB23F1DC0ABFD35D1216B80926FF45CEA2 | sha512: 1A159ED41029880B5F7E1D1D1B28133ED1FF865E13F4C1DE4F4E6A2064AA6EDF0F555B85B9196359C3BF646E37DC5908D950B7B99E91E139178EB3F6295CD540
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<enforceFIPSPolicy enabled="false"/>
</runtime>
</configuration>
CheckSum is licensed as Apache v2 - https://raw.github.com/ferventcoder/checksum/master/LICENSE
md5: 2D607C9E6AAC0334ECA99A2FF02C179A | sha1: 8F744E72E0E7F25A7B4CB155AE82A98DD56C578E | sha256: 907F5FED113A746BFECBECF861F226927376EC457B88F16C2E56B99C8594EA19 | sha512: 28A38549BD56B3D50DC683420C54F658E8BC790563809B4F9E7712CE650367A457EA16B7A9300C1BBDD366A771D7A55F221547FC48390D86056F2985A2C0E9B6
md5: 4291B571D3C5BC5A1BB272ECC9201C0E | sha1: D0E59D3D48C17D4A81002DB51A5ABC90973FAA5E | sha256: FEA72BEBB2F5A38718A6CB75329FABAB41C3101DF1F9C7CEE226D830C706AE61 | sha512: DD6464AA07D8D3850C5DD28D934EA737B04647B200496EBDF5FC5A28A165723312A335B1FA7CB1B8D2E69507522F7678FDBBC85390B050B627B1F6C41B48186B
Shim Generator - shimgen.exe
Copyright (C) 2013 - 2017 RealDimensions Software, LLC ("RDS")
===================================================================
Grant of License
===================================================================
You may use Shim Generator ("shimgen.exe") only with the official Chocolatey
client. The use of shimgen.exe for any other reason is strictly prohibited.
If you would like to use this software for any other reason, you must obtain a
personal or commercial license to do so. To do that you must contact RDS at
ferventcoder.com.
This software is not free to distribute apart from the Chocolatey client. If you
would like to distribute this software outside of use through Chocolatey, you
must receive written permission from the software owner.
===================================================================
End-User License Agreement
===================================================================
EULA - Shim Generator
IMPORTANT- READ CAREFULLY: This RealDimensions Software ("RDS") End-User License
Agreement ("EULA") is a legal agreement between you ("END USER") and RDS for all
RDS products, controls, source code, demos, intermediate files, media, printed
materials, and "online" or electronic documentation ("SOFTWARE PRODUCT(S)")
contained with this distribution.
RDS grants to END USER as an individual, a personal, nonexclusive license to
install and use the SOFTWARE PRODUCT(S) for the sole purpose of use with the
official Chocolatey client. By installing, copying, or otherwise using the
SOFTWARE PRODUCT(S), END USER agrees to be bound by the terms of this EULA. If
END USER does not agree to any part of the terms of this EULA, DO NOT INSTALL,
USE, OR EVALUATE, ANY PART, FILE OR PORTION OF THE SOFTWARE PRODUCT(S).
ALL SOFTWARE PRODUCT(S) are licensed not sold. If END USER is an individual,
END USER must acquire an individual license for the SOFTWARE PRODUCT(S) from RDS
or its authorized resellers. If END USER is an entity, END USER must acquire an
individual license for each machine running the SOFTWARE PRODUCT(S) within your
organization from RDS or its authorized resellers. Both Virtual and Physical
Machines running the SOFTWARE PRODUCT(S) must be counted in the SOFTWARE
PRODUCT(S) licenses quantity of the organization.
===================================================================
Commercial / Personal Licensing
===================================================================
Shim Generator (shimgen.exe) is also offered under personal and commercial
licenses. You can learn more about this option by contacting RDS at
http://ferventcoder.com
$thisScriptFolder = (Split-Path -parent $MyInvocation.MyCommand.Definition)
$chocInstallVariableName = "ChocolateyInstall"
$sysDrive = $env:SystemDrive
$tempDir = $env:TEMP
$defaultChocolateyPathOld = "$sysDrive\Chocolatey"
$originalForegroundColor = $host.ui.RawUI.ForegroundColor
function Write-ChocolateyWarning {
param (
[string]$message = ''
)
try {
Write-Host "WARNING: $message" -ForegroundColor "Yellow" -ErrorAction "Stop"
} catch {
Write-Output "WARNING: $message"
}
}
function Write-ChocolateyError {
param (
[string]$message = ''
)
try {
Write-Host "ERROR: $message" -ForegroundColor "Red" -ErrorAction "Stop"
} catch {
Write-Output "ERROR: $message"
}
}
function Initialize-Chocolatey {
<#
.DESCRIPTION
This will initialize the Chocolatey tool by
a) setting up the "chocolateyPath" (the location where all chocolatey nuget packages will be installed)
b) Installs chocolatey into the "chocolateyPath"
c) Instals .net 4.0 if needed
d) Adds Chocolatey to the PATH environment variable so you have access to the choco commands.
.PARAMETER ChocolateyPath
Allows you to override the default path of (C:\ProgramData\chocolatey\) by specifying a directory chocolatey will install nuget packages.
.EXAMPLE
C:\PS> Initialize-Chocolatey
Installs chocolatey into the default C:\ProgramData\Chocolatey\ directory.
.EXAMPLE
C:\PS> Initialize-Chocolatey -chocolateyPath "D:\ChocolateyInstalledNuGets\"
Installs chocolatey into the custom directory D:\ChocolateyInstalledNuGets\
#>
param(
[Parameter(Mandatory=$false)][string]$chocolateyPath = ''
)
Write-Debug "Initialize-Chocolatey"
$installModule = Join-Path $thisScriptFolder 'chocolateyInstall\helpers\chocolateyInstaller.psm1'
Import-Module $installModule -Force
if ($chocolateyPath -eq '') {
$programData = [Environment]::GetFolderPath("CommonApplicationData")
$chocolateyPath = Join-Path "$programData" 'chocolatey'
}
# variable to allow insecure directory:
$allowInsecureRootInstall = $false
if ($env:ChocolateyAllowInsecureRootDirectory -eq 'true') { $allowInsecureRootInstall = $true }
# if we have an already environment variable path, use it.
$alreadyInitializedNugetPath = Get-ChocolateyInstallFolder
if ($alreadyInitializedNugetPath -and $alreadyInitializedNugetPath -ne $chocolateyPath -and ($allowInsecureRootInstall -or $alreadyInitializedNugetPath -ne $defaultChocolateyPathOld)){
$chocolateyPath = $alreadyInitializedNugetPath
}
else {
Set-ChocolateyInstallFolder $chocolateyPath
}
Create-DirectoryIfNotExists $chocolateyPath
Ensure-Permissions $chocolateyPath
#set up variables to add
$chocolateyExePath = Join-Path $chocolateyPath 'bin'
$chocolateyLibPath = Join-Path $chocolateyPath 'lib'
if ($tempDir -eq $null) {
$tempDir = Join-Path $chocolateyPath 'temp'
Create-DirectoryIfNotExists $tempDir
}
$yourPkgPath = [System.IO.Path]::Combine($chocolateyLibPath,"yourPackageName")
@"
We are setting up the Chocolatey package repository.
The packages themselves go to `'$chocolateyLibPath`'
(i.e. $yourPkgPath).
A shim file for the command line goes to `'$chocolateyExePath`'
and points to an executable in `'$yourPkgPath`'.
Creating Chocolatey folders if they do not already exist.
"@ | Write-Output
Write-ChocolateyWarning "You can safely ignore errors related to missing log files when `n upgrading from a version of Chocolatey less than 0.9.9. `n 'Batch file could not be found' is also safe to ignore. `n 'The system cannot find the file specified' - also safe."
#create the base structure if it doesn't exist
Create-DirectoryIfNotExists $chocolateyExePath
Create-DirectoryIfNotExists $chocolateyLibPath
Install-ChocolateyFiles $chocolateyPath
Ensure-ChocolateyLibFiles $chocolateyLibPath
Install-ChocolateyBinFiles $chocolateyPath $chocolateyExePath
$chocolateyExePathVariable = $chocolateyExePath.ToLower().Replace($chocolateyPath.ToLower(), "%DIR%..\").Replace("\\","\")
Initialize-ChocolateyPath $chocolateyExePath $chocolateyExePathVariable
Process-ChocolateyBinFiles $chocolateyExePath $chocolateyExePathVariable
$realModule = Join-Path $chocolateyPath "helpers\chocolateyInstaller.psm1"
Import-Module "$realModule" -Force
if (-not $allowInsecureRootInstall -and (Test-Path($defaultChocolateyPathOld))) {
Upgrade-OldChocolateyInstall $defaultChocolateyPathOld $chocolateyPath
Install-ChocolateyBinFiles $chocolateyPath $chocolateyExePath
}
Add-ChocolateyProfile
Install-DotNet4IfMissing
if ($env:ChocolateyExitCode -eq $null -or $env:ChocolateyExitCode -eq '') {
$env:ChocolateyExitCode = 0
}
@"
Chocolatey (choco.exe) is now ready.
You can call choco from anywhere, command line or powershell by typing choco.
Run choco /? for a list of functions.
You may need to shut down and restart powershell and/or consoles
first prior to using choco.
"@ | write-Output
if (-not $allowInsecureRootInstall) {
Remove-OldChocolateyInstall $defaultChocolateyPathOld
}
}
function Set-ChocolateyInstallFolder {
param(
[string]$folder
)
Write-Debug "Set-ChocolateyInstallFolder"
$environmentTarget = [System.EnvironmentVariableTarget]::User
# removing old variable
Install-ChocolateyEnvironmentVariable -variableName "$chocInstallVariableName" -variableValue $null -variableType $environmentTarget
if (Test-ProcessAdminRights) {
Write-Debug "Administrator installing so using Machine environment variable target instead of User."
$environmentTarget = [System.EnvironmentVariableTarget]::Machine
# removing old variable
Install-ChocolateyEnvironmentVariable -variableName "$chocInstallVariableName" -variableValue $null -variableType $environmentTarget
} else {
Write-ChocolateyWarning "Setting ChocolateyInstall Environment Variable on USER and not SYSTEM variables.`n This is due to either non-administrator install OR the process you are running is not being run as an Administrator."
}
Write-Output "Creating $chocInstallVariableName as an environment variable (targeting `'$environmentTarget`') `n Setting $chocInstallVariableName to `'$folder`'"
Write-ChocolateyWarning "It's very likely you will need to close and reopen your shell `n before you can use choco."
Install-ChocolateyEnvironmentVariable -variableName "$chocInstallVariableName" -variableValue "$folder" -variableType $environmentTarget
}
function Get-ChocolateyInstallFolder(){
Write-Debug "Get-ChocolateyInstallFolder"
[Environment]::GetEnvironmentVariable($chocInstallVariableName)
}
function Create-DirectoryIfNotExists($folderName){
Write-Debug "Create-DirectoryIfNotExists"
if (![System.IO.Directory]::Exists($folderName)) { [System.IO.Directory]::CreateDirectory($folderName) | Out-Null }
}
function Get-LocalizedWellKnownPrincipalName {
param (
[Parameter(Mandatory = $true)]
[Security.Principal.WellKnownSidType] $WellKnownSidType
)
$sid = New-Object -TypeName 'System.Security.Principal.SecurityIdentifier' -ArgumentList @($WellKnownSidType, $null)
$account = $sid.Translate([Security.Principal.NTAccount])
return $account.Value
}
function Ensure-Permissions {
param(
[string]$folder
)
Write-Debug "Ensure-Permissions"
$defaultInstallPath = "$env:SystemDrive\ProgramData\chocolatey"
try {
$defaultInstallPath = Join-Path ([Environment]::GetFolderPath("CommonApplicationData")) 'chocolatey'
} catch {
# keep first setting
}
if ($folder.ToLower() -ne $defaultInstallPath.ToLower()) {
Write-ChocolateyWarning "Installation folder is not the default. Not changing permissions. Please ensure your installation is secure."
return
}
# Everything from here on out applies to the default installation folder
if (!(Test-ProcessAdminRights)) {
throw "Installation of Chocolatey to default folder requires Administrative permissions. Please run from elevated prompt. Please see https://chocolatey.org/install for details and alternatives if needing to install as a non-administrator."
}
$currentEA = $ErrorActionPreference
$ErrorActionPreference = 'Stop'
try {
# get current acl
$acl = (Get-Item $folder).GetAccessControl('Access,Owner')
Write-Debug "Removing existing permissions."
$acl.Access | % { $acl.RemoveAccessRuleAll($_) }
$inheritanceFlags = ([Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [Security.AccessControl.InheritanceFlags]::ObjectInherit)
$propagationFlags = [Security.AccessControl.PropagationFlags]::None
$rightsFullControl = [Security.AccessControl.FileSystemRights]::FullControl
$rightsModify = [Security.AccessControl.FileSystemRights]::Modify
$rightsReadExecute = [Security.AccessControl.FileSystemRights]::ReadAndExecute
$rightsWrite = [Security.AccessControl.FileSystemRights]::Write
Write-Output "Restricting write permissions to Administrators"
$builtinAdmins = Get-LocalizedWellKnownPrincipalName -WellKnownSidType ([Security.Principal.WellKnownSidType]::BuiltinAdministratorsSid)
$adminsAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($builtinAdmins, $rightsFullControl, $inheritanceFlags, $propagationFlags, "Allow")
$acl.SetAccessRule($adminsAccessRule)
$localSystem = Get-LocalizedWellKnownPrincipalName -WellKnownSidType ([Security.Principal.WellKnownSidType]::LocalSystemSid)
$localSystemAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($localSystem, $rightsFullControl, $inheritanceFlags, $propagationFlags, "Allow")
$acl.SetAccessRule($localSystemAccessRule)
$builtinUsers = Get-LocalizedWellKnownPrincipalName -WellKnownSidType ([Security.Principal.WellKnownSidType]::BuiltinUsersSid)
$usersAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($builtinUsers, $rightsReadExecute, $inheritanceFlags, $propagationFlags, "Allow")
$acl.SetAccessRule($usersAccessRule)
$allowCurrentUser = $env:ChocolateyInstallAllowCurrentUser -eq 'true'
if ($allowCurrentUser) {
# get current user
$currentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
if ($currentUser.Name -ne $localSystem) {
$userAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($currentUser.Name, $rightsModify, $inheritanceFlags, $propagationFlags, "Allow")
Write-ChocolateyWarning 'Adding Modify permission for current user due to $env:ChocolateyInstallAllowCurrentUser. This could lead to escalation of privilege attacks. Consider not allowing this.'
$acl.SetAccessRule($userAccessRule)
}
} else {
Write-Debug 'Current user no longer set due to possible escalation of privileges - set $env:ChocolateyInstallAllowCurrentUser="true" if you require this.'
}
Write-Debug "Set Owner to Administrators"
$builtinAdminsSid = New-Object System.Security.Principal.SecurityIdentifier([Security.Principal.WellKnownSidType]::BuiltinAdministratorsSid, $null)
$acl.SetOwner($builtinAdminsSid)
Write-Debug "Default Installation folder - removing inheritance with no copy"
$acl.SetAccessRuleProtection($true, $false)
# enact the changes against the actual
(Get-Item $folder).SetAccessControl($acl)
# set an explicit append permission on the logs folder
Write-Debug "Allow users to append to log files."
$logsFolder = "$folder\logs"
Create-DirectoryIfNotExists $logsFolder
$logsAcl = (Get-Item $logsFolder).GetAccessControl('Access')
$usersAppendAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($builtinUsers, $rightsWrite, [Security.AccessControl.InheritanceFlags]::ObjectInherit, [Security.AccessControl.PropagationFlags]::InheritOnly, "Allow")
$logsAcl.SetAccessRule($usersAppendAccessRule)
$logsAcl.SetAccessRuleProtection($false, $true)
(Get-Item $logsFolder).SetAccessControl($logsAcl)
} catch {
Write-ChocolateyWarning "Not able to set permissions for $folder."
}
$ErrorActionPreference = $currentEA
}
function Upgrade-OldChocolateyInstall {
param(
[string]$chocolateyPathOld = "$sysDrive\Chocolatey",
[string]$chocolateyPath = "$($env:ALLUSERSPROFILE)\chocolatey"
)
Write-Debug "Upgrade-OldChocolateyInstall"
if (Test-Path $chocolateyPathOld) {
Write-Output "Attempting to upgrade `'$chocolateyPathOld`' to `'$chocolateyPath`'."
Write-ChocolateyWarning "Copying the contents of `'$chocolateyPathOld`' to `'$chocolateyPath`'. `n This step may fail if you have anything in this folder running or locked."
Write-Output 'If it fails, just manually copy the rest of the items out and then delete the folder.'
Write-ChocolateyWarning "!!!! ATTN: YOU WILL NEED TO CLOSE AND REOPEN YOUR SHELL !!!!"
#-ForegroundColor Magenta -BackgroundColor Black
$chocolateyExePathOld = Join-Path $chocolateyPathOld 'bin'
'Machine', 'User' |
% {
$path = Get-EnvironmentVariable -Name 'PATH' -Scope $_
$updatedPath = [System.Text.RegularExpressions.Regex]::Replace($path,[System.Text.RegularExpressions.Regex]::Escape($chocolateyExePathOld) + '(?>;)?', '', [System.Text.RegularExpressions.RegexOptions]::IgnoreCase)
if ($updatedPath -ne $path) {
Write-Output "Updating `'$_`' PATH to reflect removal of '$chocolateyPathOld'."
try {
Set-EnvironmentVariable -Name 'Path' -Value $updatedPath -Scope $_ -ErrorAction Stop
} catch {
Write-ChocolateyWarning "Was not able to remove the old environment variable from PATH. You will need to do this manually"
}
}
}
Copy-Item "$chocolateyPathOld\lib\*" "$chocolateyPath\lib" -force -recurse
$from = "$chocolateyPathOld\bin"
$to = "$chocolateyPath\bin"
$exclude = @("choco.exe", "chocolatey.exe", "cinst.exe", "clist.exe", "cpack.exe", "cpush.exe", "cuninst.exe", "cup.exe", "cver.exe", "RefreshEnv.cmd")
Get-ChildItem -Path $from -recurse -Exclude $exclude |
% {
Write-Debug "Copying $_ `n to $to"
if ($_.PSIsContainer) {
Copy-Item $_ -Destination (Join-Path $to $_.Parent.FullName.Substring($from.length)) -Force -ErrorAction SilentlyContinue
} else {
$fileToMove = (Join-Path $to $_.FullName.Substring($from.length))
try {
Copy-Item $_ -Destination $fileToMove -Exclude $exclude -Force -ErrorAction Stop
}
catch {
Write-ChocolateyWarning "Was not able to move `'$fileToMove`'. You may need to reinstall the shim"
}
}
}
}
}
function Remove-OldChocolateyInstall {
param(
[string]$chocolateyPathOld = "$sysDrive\Chocolatey"
)
Write-Debug "Remove-OldChocolateyInstall"
if (Test-Path $chocolateyPathOld) {
Write-ChocolateyWarning "This action will result in Log Errors, you can safely ignore those. `n You may need to finish removing '$chocolateyPathOld' manually."
try {
Get-ChildItem -Path "$chocolateyPathOld" | % {
if (Test-Path $_.FullName) {
Write-Debug "Removing $_ unless matches .log"
Remove-Item $_.FullName -exclude *.log -recurse -force -ErrorAction SilentlyContinue
}
}
Write-Output "Attempting to remove `'$chocolateyPathOld`'. This may fail if something in the folder is being used or locked."
Remove-Item "$($chocolateyPathOld)" -force -recurse -ErrorAction Stop
}
catch {
Write-ChocolateyWarning "Was not able to remove `'$chocolateyPathOld`'. You will need to manually remove it."
}
}
}
function Install-ChocolateyFiles {
param(
[string]$chocolateyPath
)
Write-Debug "Install-ChocolateyFiles"
Write-Debug "Removing install files in chocolateyInstall, helpers, redirects, and tools"
"$chocolateyPath\chocolateyInstall", "$chocolateyPath\helpers", "$chocolateyPath\redirects", "$chocolateyPath\tools" | % {
#Write-Debug "Checking path $_"
if (Test-Path $_) {
Get-ChildItem -Path "$_" | % {
#Write-Debug "Checking child path $_ ($($_.FullName))"
if (Test-Path $_.FullName) {
Write-Debug "Removing $_ unless matches .log"
Remove-Item $_.FullName -exclude *.log -recurse -force -ErrorAction SilentlyContinue
}
}
}
}
Write-Debug "Attempting to move choco.exe to choco.exe.old so we can place the new version here."
# rename the currently running process / it will be locked if it exists
$chocoExe = Join-Path $chocolateyPath 'choco.exe'
if (Test-Path ($chocoExe)) {
Write-Debug "Renaming '$chocoExe' to '$chocoExe.old'"
try {
Remove-Item "$chocoExe.old" -force -ErrorAction SilentlyContinue
Move-Item $chocoExe "$chocoExe.old" -force -ErrorAction SilentlyContinue
}
catch {
Write-ChocolateyWarning "Was not able to rename `'$chocoExe`' to `'$chocoExe.old`'."
}
}
Write-Debug "Unpacking files required for Chocolatey."
$chocInstallFolder = Join-Path $thisScriptFolder "chocolateyInstall"
$chocoExe = Join-Path $chocInstallFolder 'choco.exe'
$chocoExeDest = Join-Path $chocolateyPath 'choco.exe'
Copy-Item $chocoExe $chocoExeDest -force
Write-Debug "Copying the contents of `'$chocInstallFolder`' to `'$chocolateyPath`'."
Copy-Item $chocInstallFolder\* $chocolateyPath -recurse -force
}
function Ensure-ChocolateyLibFiles {
param(
[string]$chocolateyLibPath
)
Write-Debug "Ensure-ChocolateyLibFiles"
$chocoPkgDirectory = Join-Path $chocolateyLibPath 'chocolatey'
Create-DirectoryIfNotExists $chocoPkgDirectory
if (!(Test-Path("$chocoPkgDirectory\chocolatey.nupkg"))) {
Write-Output "chocolatey.nupkg file not installed in lib.`n Attempting to locate it from bootstrapper."
$chocoZipFile = Join-Path $tempDir "chocolatey\chocInstall\chocolatey.zip"
Write-Debug "First the zip file at '$chocoZipFile'."
Write-Debug "Then from a neighboring chocolatey.*nupkg file '$thisScriptFolder/../../'."
if (Test-Path("$chocoZipFile")) {
Write-Debug "Copying '$chocoZipFile' to '$chocoPkgDirectory\chocolatey.nupkg'."
Copy-Item "$chocoZipFile" "$chocoPkgDirectory\chocolatey.nupkg" -Force -ErrorAction SilentlyContinue
}
if (!(Test-Path("$chocoPkgDirectory\chocolatey.nupkg"))) {
$chocoPkg = Get-ChildItem "$thisScriptFolder/../../" | ?{$_.name -match "^chocolatey.*nupkg" } | Sort name -Descending | Select -First 1
if ($chocoPkg -ne '') { $chocoPkg = $chocoPkg.FullName }
"$chocoZipFile", "$chocoPkg" | % {
if ($_ -ne $null -and $_ -ne '') {
if (Test-Path $_) {
Write-Debug "Copying '$_' to '$chocoPkgDirectory\chocolatey.nupkg'."
Copy-Item $_ "$chocoPkgDirectory\chocolatey.nupkg" -Force -ErrorAction SilentlyContinue
}
}
}
}
}
}
function Install-ChocolateyBinFiles {
param(
[string] $chocolateyPath,
[string] $chocolateyExePath
)
Write-Debug "Install-ChocolateyBinFiles"
Write-Debug "Installing the bin file redirects"
$redirectsPath = Join-Path $chocolateyPath 'redirects'
if (!(Test-Path "$redirectsPath")) {
Write-ChocolateyWarning "$redirectsPath does not exist"
return
}
$exeFiles = Get-ChildItem "$redirectsPath" -include @("*.exe","*.cmd") -recurse
foreach ($exeFile in $exeFiles) {
$exeFilePath = $exeFile.FullName
$exeFileName = [System.IO.Path]::GetFileName("$exeFilePath")
$binFilePath = Join-Path $chocolateyExePath $exeFileName
$binFilePathRename = $binFilePath + '.old'
$batchFilePath = $binFilePath.Replace(".exe",".bat")
$bashFilePath = $binFilePath.Replace(".exe","")
if (Test-Path ($batchFilePath)) { Remove-Item $batchFilePath -force -ErrorAction SilentlyContinue }
if (Test-Path ($bashFilePath)) { Remove-Item $bashFilePath -force -ErrorAction SilentlyContinue }
if (Test-Path ($binFilePathRename)) {
try {
Write-Debug "Attempting to remove $binFilePathRename"
Remove-Item $binFilePathRename -force -ErrorAction Stop
}
catch {
Write-ChocolateyWarning "Was not able to remove `'$binFilePathRename`'. This may cause errors."
}
}
if (Test-Path ($binFilePath)) {
try {
Write-Debug "Attempting to rename $binFilePath to $binFilePathRename"
Move-Item -path $binFilePath -destination $binFilePathRename -force -ErrorAction Stop
}
catch {
Write-ChocolateyWarning "Was not able to rename `'$binFilePath`' to `'$binFilePathRename`'."
}
}
try {
Write-Debug "Attempting to copy $exeFilePath to $binFilePath"
Copy-Item -path $exeFilePath -destination $binFilePath -force -ErrorAction Stop
}
catch {
Write-ChocolateyWarning "Was not able to replace `'$binFilePath`' with `'$exeFilePath`'. You may need to do this manually."
}
$commandShortcut = [System.IO.Path]::GetFileNameWithoutExtension("$exeFilePath")
Write-Debug "Added command $commandShortcut"
}
}
function Initialize-ChocolateyPath {
param(
[string]$chocolateyExePath = "$($env:ALLUSERSPROFILE)\chocolatey\bin",
[string]$chocolateyExePathVariable = "%$($chocInstallVariableName)%\bin"
)
Write-Debug "Initialize-ChocolateyPath"
Write-Debug "Initializing Chocolatey Path if required"
$environmentTarget = [System.EnvironmentVariableTarget]::User
if (Test-ProcessAdminRights) {
Write-Debug "Administrator installing so using Machine environment variable target instead of User."
$environmentTarget = [System.EnvironmentVariableTarget]::Machine
} else {
Write-ChocolateyWarning "Setting ChocolateyInstall Path on USER PATH and not SYSTEM Path.`n This is due to either non-administrator install OR the process you are running is not being run as an Administrator."
}
Install-ChocolateyPath -pathToInstall "$chocolateyExePath" -pathType $environmentTarget
}
function Process-ChocolateyBinFiles {
param(
[string]$chocolateyExePath = "$($env:ALLUSERSPROFILE)\chocolatey\bin",
[string]$chocolateyExePathVariable = "%$($chocInstallVariableName)%\bin"
)
Write-Debug "Process-ChocolateyBinFiles"
$processedMarkerFile = Join-Path $chocolateyExePath '_processed.txt'
if (!(test-path $processedMarkerFile)) {
$files = get-childitem $chocolateyExePath -include *.bat -recurse
if ($files -ne $null -and $files.Count -gt 0) {
Write-Debug "Processing Bin files"
foreach ($file in $files) {
Write-Output "Processing $($file.Name) to make it portable"
$fileStream = [System.IO.File]::Open("$file", 'Open', 'Read', 'ReadWrite')
$reader = New-Object System.IO.StreamReader($fileStream)
$fileText = $reader.ReadToEnd()
$reader.Close()
$fileStream.Close()
$fileText = $fileText.ToLower().Replace("`"" + $chocolateyPath.ToLower(), "SET DIR=%~dp0%`n""%DIR%..\").Replace("\\","\")
Set-Content $file -Value $fileText -Encoding Ascii
}
}
Set-Content $processedMarkerFile -Value "$([System.DateTime]::Now.Date)" -Encoding Ascii
}
}
# Adapted from http://www.west-wind.com/Weblog/posts/197245.aspx
function Get-FileEncoding($Path) {
$bytes = [byte[]](Get-Content $Path -Encoding byte -ReadCount 4 -TotalCount 4)
if(!$bytes) { return 'utf8' }
switch -regex ('{0:x2}{1:x2}{2:x2}{3:x2}' -f $bytes[0],$bytes[1],$bytes[2],$bytes[3]) {
'^efbbbf' { return 'utf8' }
'^2b2f76' { return 'utf7' }
'^fffe' { return 'unicode' }
'^feff' { return 'bigendianunicode' }
'^0000feff' { return 'utf32' }
default { return 'ascii' }
}
}
function Add-ChocolateyProfile {
Write-Debug "Add-ChocolateyProfile"
try {
$profileFile = "$profile"
if ($profileFile -eq $null -or $profileFile -eq '') {
Write-Output 'Not setting tab completion: Profile variable ($profile) resulted in an empty string.'
return
}
$profileDirectory = (Split-Path -Parent $profileFile)
if ($env:ChocolateyNoProfile -ne $null -and $env:ChocolateyNoProfile -ne '') {
Write-Warning "Not setting tab completion: Environment variable "ChocolateyNoProfile" exists and is set."
return
}
$localSystem = Get-LocalizedWellKnownPrincipalName -WellKnownSidType ([Security.Principal.WellKnownSidType]::LocalSystemSid)
# get current user
$currentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
if ($currentUser.Name -eq $localSystem) {
Write-Warning "Not setting tab completion: Current user is SYSTEM user."
return
}
if (!(Test-Path($profileDirectory))) {
Write-Debug "Creating '$profileDirectory'"
New-Item "$profileDirectory" -Type Directory -Force -ErrorAction SilentlyContinue | Out-Null
}
if (!(Test-Path($profileFile))) {
Write-Warning "Not setting tab completion: Profile file does not exist at '$profileFile'."
return
#Write-Debug "Creating '$profileFile'"
#"" | Out-File $profileFile -Encoding UTF8
}
$signature = Get-AuthenticodeSignature $profile
if ($signature.Status -ne 'NotSigned') {
Write-Warning "Not setting tab completion: File is Authenticode signed at '$profile'."
return
}
$profileInstall = @'
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
'@
$chocoProfileSearch = '$ChocolateyProfile'
if(Select-String -Path $profileFile -Pattern $chocoProfileSearch -Quiet -SimpleMatch) {
Write-Debug "Chocolatey profile is already installed."
return
}
Write-Output 'Adding Chocolatey to the profile. This will provide tab completion, refreshenv, etc.'
$profileInstall | Out-File $profileFile -Append -Encoding (Get-FileEncoding $profileFile)
Write-ChocolateyWarning 'Chocolatey profile installed. Reload your profile - type . $profile'
if ($PSVersionTable.PSVersion.Major -lt 3) {
Write-ChocolateyWarning "Tab completion does not currently work in PowerShell v2. `n Please upgrade to a more recent version of PowerShell to take advantage of tab completion."
#Write-ChocolateyWarning "To load tab expansion, you need to install PowerTab. `n See https://powertab.codeplex.com/ for details."
}
} catch {
Write-ChocolateyWarning "Unable to add Chocolatey to the profile. You will need to do it manually. Error was '$_'"
@'
This is how add the Chocolatey Profile manually.
Find your $profile. Then add the following lines to it:
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
'@ | Write-Output
}
}
$netFx4InstallTries = 0
function Install-DotNet4IfMissing {
param(
$forceFxInstall = $false
)
# we can't take advantage of any chocolatey module functions, because they
# haven't been unpacked because they require .NET Framework 4.0
Write-Debug "Install-DotNet4IfMissing called with `$forceFxInstall=$forceFxInstall"
$NetFxArch = "Framework"
if ([IntPtr]::Size -eq 8) {$NetFxArch="Framework64" }
$NetFx4ClientUrl = 'https://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe'
$NetFx4FullUrl = 'https://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe'
$NetFx4Url = $NetFx4FullUrl
$NetFx4Path = "$tempDir"
$NetFx4InstallerFile = 'dotNetFx40_Full_x86_x64.exe'
$NetFx4Installer = Join-Path $NetFx4Path $NetFx4InstallerFile
if ((!(Test-Path "$env:SystemRoot\Microsoft.Net\$NetFxArch\v4.0.30319") -and !(Test-Path "C:\Windows\Microsoft.Net\$NetFxArch\v4.0.30319")) -or $forceFxInstall) {
Write-Output "'$env:SystemRoot\Microsoft.Net\$NetFxArch\v4.0.30319' was not found or this is forced"
if (!(Test-Path $NetFx4Path)) {
Write-Output "Creating folder `'$NetFx4Path`'"
$null = New-Item -Path "$NetFx4Path" -ItemType Directory
}
$netFx4InstallTries += 1
if (!(Test-Path $NetFx4Installer)) {
Write-Output "Downloading `'$NetFx4Url`' to `'$NetFx4Installer`' - the installer is 40+ MBs, so this could take a while on a slow connection."
(New-Object Net.WebClient).DownloadFile("$NetFx4Url","$NetFx4Installer")
}
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.WorkingDirectory = "$NetFx4Path"
$psi.FileName = "$NetFx4InstallerFile"
# https://msdn.microsoft.com/library/ee942965(v=VS.100).aspx#command_line_options
# http://blogs.msdn.com/b/astebner/archive/2010/05/12/10011664.aspx
# For the actual setup.exe (if you want to unpack first) - /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart
$psi.Arguments = "/q /norestart /repair"
Write-Output "Installing `'$NetFx4Installer`' - this may take awhile with no output."
$s = [System.Diagnostics.Process]::Start($psi);
$s.WaitForExit();
if ($s.ExitCode -ne 0 -and $s.ExitCode -ne 3010) {
if ($netFx4InstallTries -ge 2) {
Write-ChocolateyError ".NET Framework install failed with exit code `'$($s.ExitCode)`'. `n This will cause the rest of the install to fail."
throw "Error installing .NET Framework 4.0 (exit code $($s.ExitCode)). `n Please install the .NET Framework 4.0 manually and then try to install Chocolatey again. `n Download at `'$NetFx4Url`'"
} else {
Write-ChocolateyWarning "Try #$netFx4InstallTries of .NET framework install failed with exit code `'$($s.ExitCode)`'. Trying again."
Install-DotNet4IfMissing $true
}
}
}
}
Export-ModuleMember -function Initialize-Chocolatey;
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQ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HATAcBgkqhkiG9w0B
# CQUxDxcNMTcwNTAzMTkyNDM3WjAjBgkqhkiG9w0BCQQxFgQUrQuQY7T/w7PHtnLK
# wUXn4aC9CzgwDQYJKoZIhvcNAQEBBQAEggEAFS42p8RIzs76JM4bhCPA5OF5Nxbl
# 8oXDeI5nplV+KbLPIaTtLigw2W30+TT/fFw1FU7hw9taHVR4JyzFOA8rA7YzCXTg
# D35GVFDkslbLkPg7msS17PhknYE4ViBxbUpW3ZQZPCQNg26Ze9xz5hKeYToQew4h
# iPpJ/KVxfMnwJlm0NOm6knGSQ+k9GAagBjnaA+CPJPk2Rp13Qeo3rMCuVt/vn+io
# Npw9hNcjn/UoNzQJCTpA1bbXZcFbd4hO8z/j6cohJJl0chmOQppfMB5uGukn/MB/
# D7B6SmYcdf4loUGK7G1OArkqG7GkekRh2i5EvkAsWEP9Uh3mDz15x0qA8w==
# SIG # End signature block
param($installPath, $toolsPath, $package, $project)
$modules = Get-ChildItem $ToolsPath -Filter *.psm1
$modules | ForEach-Object { import-module -name $_.FullName }
@"
========================
Chocolatey
========================
Welcome to Chocolatey, your local machine repository built on the NuGet infrastructure. Chocolatey allows you to install application packages to your machine with the goodness of a #chocolatey #nuget combo.
Application executables get added to the path automatically so you can call them from anywhere (command line/powershell prompt), not just in Visual Studio.
Lets get Chocolatey!
----------
Visual Studio -
----------
Please run Initialize-Chocolatey one time per machine to set up the repository.
If you are upgrading, please remember to run Initialize-Chocolatey again.
After you have run Initialize-Chocolatey, you can safely uninstall the chocolatey package from your current Visual Studio solution.
----------
Alternative NuGet -
----------
If you are not using NuGet in Visual Studio, please navigate to the directory with the chocolateysetup.psm1 and run that in Powershell, followed by Initialize-Chocolatey.
Upgrade is the same, just run Initialize-Chocolatey again.
----------
Once you've run initialize or upgrade, you can uninstall this package from the local project without affecting your chocolatey repository.
========================
"@ | Write-Host
Log in or click on link to see number of positives.
- detector.zip (907f5fed113a) - ## / 57
- 7z.exe (27a05f5c210d) - ## / 72
- 7z.dll (271b01107b1f) - ## / 62
- chocolatey.0.10.6-beta-20170503.nupkg (2ae28bfd949d) - ## / 59
- checksum.exe (eb87b365251c) - ## / 62
- choco.exe (224321b57ecb) - ## / 62
- chocolatey.exe (fdc70aeed54f) - ## / 59
- cinst.exe (007a39f29511) - ## / 62
- clist.exe (81dd2ad0e42e) - ## / 26
- cpack.exe (5a2ce541f5b9) - ## / 26
- cpush.exe (900cf5f4f4ef) - ## / 61
- cuninst.exe (358b1b70f7fb) - ## / 60
- cup.exe (c9e682bb2fb1) - ## / 62
- cver.exe (9769167b8c1e) - ## / 60
- shimgen.exe (fea72bebb2f5) - ## / 62
- choco.exe (44d5164c8eff) - ## / 61
In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).
Chocolatey Pro provides runtime protection from possible malware.
Version | Downloads | Last Updated | Status |
---|---|---|---|
Chocolatey 2.4.0 | 1599531 | Tuesday, November 12, 2024 | Approved |
Chocolatey 2.3.0 | 8883847 | Wednesday, June 5, 2024 | Approved |
Chocolatey 2.2.2 | 25326245 | Tuesday, August 8, 2023 | Approved |
Chocolatey 2.2.0 | 3347073 | Wednesday, July 26, 2023 | Exempted |
Chocolatey 2.1.0 | 6328445 | Thursday, June 29, 2023 | Exempted |
Chocolatey 2.1.0-alpha-20230614 | 2195 | Wednesday, June 14, 2023 | Exempted |
Chocolatey 2.1.0-alpha-20230608 | 993 | Thursday, June 8, 2023 | Exempted |
Chocolatey 2.0.0 | 9675286 | Wednesday, May 31, 2023 | Exempted |
Chocolatey 2.0.0-beta-20230426 | 4116 | Wednesday, April 26, 2023 | Exempted |
Chocolatey 2.0.0-beta-20230412 | 1749 | Wednesday, April 12, 2023 | Exempted |
Chocolatey 2.0.0-beta-20230321 | 2043 | Tuesday, March 21, 2023 | Exempted |
Chocolatey 2.0.0-alpha-20230307 | 1328 | Tuesday, March 7, 2023 | Exempted |
Chocolatey 2.0.0-alpha-20230221 | 1155 | Tuesday, February 21, 2023 | Exempted |
Chocolatey 2.0.0-alpha-20230124 | 1182 | Tuesday, January 24, 2023 | Exempted |
Chocolatey 1.4.0 | 2789011 | Wednesday, May 10, 2023 | Exempted |
Chocolatey 1.3.1 | 5214463 | Tuesday, March 14, 2023 | Exempted |
Chocolatey 1.3.0 | 3246275 | Wednesday, February 15, 2023 | Exempted |
Chocolatey 1.2.1 | 6479160 | Tuesday, December 6, 2022 | Approved |
Chocolatey 1.2.0 | 1723470 | Wednesday, October 19, 2022 | Approved |
Chocolatey 1.1.0 | 8370462 | Wednesday, March 30, 2022 | Exempted |
Chocolatey 1.0.1 | 1055705 | Thursday, March 24, 2022 | Exempted |
Chocolatey 1.0.0 | 872771 | Monday, March 21, 2022 | Exempted |
Chocolatey 0.12.1 | 4191213 | Tuesday, January 25, 2022 | Exempted |
Chocolatey 0.12.0 | 1089165 | Tuesday, January 18, 2022 | Exempted |
Chocolatey 0.11.3 | 5643802 | Wednesday, October 27, 2021 | Exempted |
Chocolatey 0.11.2 | 6979550 | Thursday, September 23, 2021 | Exempted |
Chocolatey 0.11.1 | 3908011 | Thursday, September 2, 2021 | Exempted |
Chocolatey 0.10.16-beta-20200806 | 15137 | Thursday, August 6, 2020 | Approved |
Chocolatey 0.10.15 | 71774531 | Monday, June 3, 2019 | Approved |
Chocolatey 0.10.15-beta-20190531 | 1226 | Friday, May 31, 2019 | Approved |
Chocolatey 0.10.14 | 510561 | Thursday, May 30, 2019 | Approved |
Chocolatey 0.10.14-beta-20190418 | 5618 | Thursday, April 18, 2019 | Approved |
Chocolatey 0.10.14-beta-20190402 | 3068 | Tuesday, April 2, 2019 | Approved |
Chocolatey 0.10.14-beta-20190321 | 2590 | Friday, March 22, 2019 | Approved |
Chocolatey 0.10.13 | 7774000 | Friday, March 15, 2019 | Approved |
Chocolatey 0.10.12 | 152517 | Friday, March 15, 2019 | Approved |
Chocolatey 0.10.12-beta-20181011 | 15390 | Friday, October 12, 2018 | Approved |
Chocolatey 0.10.12-beta-20181009 | 935 | Tuesday, October 9, 2018 | Approved |
Chocolatey 0.10.11 | 29155692 | Friday, May 4, 2018 | Approved |
Chocolatey 0.10.10 | 2954431 | Thursday, April 12, 2018 | Approved |
Chocolatey 0.10.9 | 5427014 | Sunday, March 25, 2018 | Approved |
Chocolatey 0.10.9-beta-20180223 | 3789 | Friday, February 23, 2018 | Approved |
Chocolatey 0.10.8 | 24666980 | Wednesday, August 30, 2017 | Approved |
Chocolatey 0.10.8-beta-20170806 | 5285 | Monday, August 7, 2017 | Approved |
Chocolatey 0.10.7 | 18322134 | Thursday, June 8, 2017 | Approved |
Chocolatey 0.10.6.1 | 847879 | Saturday, June 3, 2017 | Approved |
Chocolatey 0.10.6 | 413351 | Thursday, June 1, 2017 | Approved |
Chocolatey 0.10.6-beta-20170531 | 1053 | Thursday, June 1, 2017 | Approved |
Chocolatey 0.10.6-beta-20170503 | 8273 | Wednesday, May 3, 2017 | Approved |
Chocolatey 0.10.5 | 18050501 | Thursday, March 30, 2017 | Approved |
Chocolatey 0.10.4 | 174323 | Thursday, March 30, 2017 | Approved |
Chocolatey 0.10.4-beta1-20170326 | 936 | Sunday, March 26, 2017 | Approved |
Chocolatey 0.10.4-beta1-20170323 | 788 | Thursday, March 23, 2017 | Approved |
Chocolatey 0.10.3 | 25541805 | Friday, October 7, 2016 | Approved |
Chocolatey 0.10.2 | 686079 | Friday, September 30, 2016 | Approved |
Chocolatey 0.10.1 | 2005652 | Monday, September 19, 2016 | Approved |
Chocolatey 0.10.0 | 3815924 | Thursday, August 11, 2016 | Approved |
Chocolatey 0.9.10.3 | 1920551 | Thursday, June 23, 2016 | Approved |
Chocolatey 0.9.10.2 | 3033 | Sunday, June 19, 2016 | Approved |
Chocolatey 0.9.10.1 | 962 | Saturday, June 18, 2016 | Approved |
Chocolatey 0.9.10 | 2401 | Friday, June 17, 2016 | Approved |
Chocolatey 0.9.10-rc1 | 713 | Monday, June 13, 2016 | Approved |
Chocolatey 0.9.10-beta-20160612 | 687 | Sunday, June 12, 2016 | Approved |
Chocolatey 0.9.10-beta-20160531 | 674 | Tuesday, May 31, 2016 | Approved |
Chocolatey 0.9.10-beta-20160528 | 636 | Saturday, May 28, 2016 | Approved |
Chocolatey 0.9.10-beta-20160527 | 714 | Friday, May 27, 2016 | Approved |
Chocolatey 0.9.10-beta-20160524 | 684 | Wednesday, May 25, 2016 | Approved |
Chocolatey 0.9.10-beta-20160509 | 787 | Monday, May 9, 2016 | Approved |
Chocolatey 0.9.10-beta-20160506 | 687 | Friday, May 6, 2016 | Approved |
Chocolatey 0.9.10-beta-20160505 | 639 | Thursday, May 5, 2016 | Approved |
Chocolatey 0.9.10-beta-20160503 | 673 | Tuesday, May 3, 2016 | Approved |
Chocolatey 0.9.10-beta-20160422 | 1049 | Friday, April 22, 2016 | Approved |
Chocolatey 0.9.10-beta-20160411 | 1204 | Monday, April 11, 2016 | Approved |
Chocolatey 0.9.10-beta-20160402 | 1117 | Saturday, April 2, 2016 | Approved |
Chocolatey 0.9.10-beta-20160330 | 690 | Thursday, March 31, 2016 | Exempted |
Chocolatey 0.9.10-beta-20160328 | 819 | Tuesday, March 29, 2016 | Approved |
Chocolatey 0.9.10-beta-20160325 | 845 | Friday, March 25, 2016 | Approved |
Chocolatey 0.9.10-beta-20160323 | 889 | Wednesday, March 23, 2016 | Approved |
Chocolatey 0.9.10-beta-20160322 | 647 | Wednesday, March 23, 2016 | Approved |
Chocolatey 0.9.10-beta-20160320 | 859 | Sunday, March 20, 2016 | Approved |
Chocolatey 0.9.10-beta-20160318 | 749 | Friday, March 18, 2016 | Approved |
Chocolatey 0.9.10-beta-20160314 | 889 | Monday, March 14, 2016 | Approved |
Chocolatey 0.9.10-beta-20160311 | 834 | Friday, March 11, 2016 | Approved |
Chocolatey 0.9.10-beta-20160302 | 1029 | Wednesday, March 2, 2016 | Approved |
Chocolatey 0.9.10-beta-20160215 | 1174 | Monday, February 15, 2016 | Approved |
Chocolatey 0.9.10-beta-20160212 | 975 | Friday, February 12, 2016 | Approved |
Chocolatey 0.9.10-beta-20160205 | 1079 | Friday, February 5, 2016 | Approved |
Chocolatey 0.9.9.12 | 387278 | Friday, March 18, 2016 | Approved |
Chocolatey 0.9.9.11 | 8574137 | Tuesday, October 6, 2015 | Approved |
Chocolatey 0.9.9.10 | 382233 | Saturday, October 3, 2015 | Approved |
Chocolatey 0.9.9.9 | 1252749 | Friday, October 2, 2015 | Approved |
Chocolatey 0.9.9.8 | 5627977 | Saturday, June 27, 2015 | Approved |
Chocolatey 0.9.9.7 | 194953 | Saturday, June 20, 2015 | Approved |
Chocolatey 0.9.9.6 | 831227 | Sunday, May 17, 2015 | Approved |
Chocolatey 0.9.9.5 | 546997 | Monday, April 20, 2015 | Approved |
Chocolatey 0.9.9.4 | 515987 | Monday, March 30, 2015 | Approved |
Chocolatey 0.9.9.3 | 3579 | Sunday, March 29, 2015 | Approved |
Chocolatey 0.9.9.2 | 25833 | Saturday, March 7, 2015 | Approved |
Chocolatey 0.9.9.1 | 8555 | Tuesday, March 3, 2015 | Approved |
Chocolatey 0.9.9 | 14643 | Tuesday, March 3, 2015 | Approved |
Chocolatey 0.9.9-rc9 | 876 | Saturday, February 28, 2015 | Approved |
Chocolatey 0.9.9-rc8 | 927 | Tuesday, February 24, 2015 | Approved |
Chocolatey 0.9.9-rc5 | 1112 | Monday, February 9, 2015 | Approved |
Chocolatey 0.9.9-rc4 | 783 | Sunday, February 8, 2015 | Approved |
Chocolatey 0.9.9-rc3 | 763 | Saturday, February 7, 2015 | Approved |
Chocolatey 0.9.9-rc2 | 727 | Friday, February 6, 2015 | Approved |
Chocolatey 0.9.9-rc1 | 754 | Wednesday, February 4, 2015 | Approved |
Chocolatey 0.9.9-beta3-20150204 | 702 | Wednesday, February 4, 2015 | Approved |
Chocolatey 0.9.9-beta2-20150202 | 768 | Monday, February 2, 2015 | Approved |
Chocolatey 0.9.9-beta-20150201 | 735 | Sunday, February 1, 2015 | Approved |
Chocolatey 0.9.9-alpha-20150201 | 736 | Sunday, February 1, 2015 | Approved |
Chocolatey 0.9.9-alpha-20150125 | 944 | Sunday, January 25, 2015 | Approved |
Chocolatey 0.9.8.33 | 1795253 | Wednesday, February 11, 2015 | Approved |
Chocolatey 0.9.8.32 | 263390 | Thursday, January 22, 2015 | Approved |
Chocolatey 0.9.8.31 | 190575 | Wednesday, January 7, 2015 | Approved |
Chocolatey 0.9.8.31-beta2 | 755 | Wednesday, January 7, 2015 | Approved |
Chocolatey 0.9.8.31-beta1 | 680 | Tuesday, January 6, 2015 | Approved |
Chocolatey 0.9.8.30-beta1 | 664 | Tuesday, January 6, 2015 | Approved |
Chocolatey 0.9.8.29 | 57042 | Friday, January 2, 2015 | Approved |
Chocolatey 0.9.8.29-beta2 | 677 | Friday, January 2, 2015 | Exempted |
Chocolatey 0.9.8.29-beta1 | 680 | Friday, January 2, 2015 | Exempted |
Chocolatey 0.9.8.29-alpha1 | 726 | Friday, January 2, 2015 | Exempted |
Chocolatey 0.9.8.28 | 812266 | Tuesday, November 4, 2014 | Approved |
Chocolatey 0.9.8.28-rc1 | 687 | Sunday, November 2, 2014 | Exempted |
Chocolatey 0.9.8.28-alpha3 | 1233 | Monday, October 6, 2014 | Approved |
Chocolatey 0.9.8.28-alpha2 | 1539 | Friday, August 1, 2014 | Approved |
Chocolatey 0.9.8.28-alpha1 | 769 | Wednesday, July 30, 2014 | Approved |
Chocolatey 0.9.8.27 | 1382144 | Monday, July 14, 2014 | Approved |
Chocolatey 0.9.8.27-beta1 | 699 | Sunday, July 13, 2014 | Approved |
Chocolatey 0.9.8.26 | 990 | Saturday, July 12, 2014 | Approved |
Chocolatey 0.9.8.26-alpha2 | 746 | Friday, July 11, 2014 | Approved |
Chocolatey 0.9.8.26-alpha1 | 762 | Friday, July 11, 2014 | Approved |
Chocolatey 0.9.8.25 | 39040 | Monday, July 7, 2014 | Approved |
Chocolatey 0.9.8.25-alpha1 | 782 | Saturday, July 5, 2014 | Approved |
Chocolatey 0.9.8.24 | 14027 | Thursday, July 3, 2014 | Approved |
Chocolatey 0.9.8.24-rc2 | 766 | Monday, June 30, 2014 | Approved |
Chocolatey 0.9.8.24-rc1 | 803 | Wednesday, June 25, 2014 | Approved |
Chocolatey 0.9.8.24-beta2 | 935 | Sunday, June 8, 2014 | Approved |
Chocolatey 0.9.8.24-beta1 | 1577 | Thursday, April 3, 2014 | Approved |
Chocolatey 0.9.8.24-alpha2 | 1009 | Sunday, March 2, 2014 | Approved |
Chocolatey 0.9.8.24-alpha1 | 868 | Tuesday, February 11, 2014 | Approved |
Chocolatey 0.9.8.23 | 525896 | Monday, November 11, 2013 | Approved |
Chocolatey 0.9.8.22 | 1504 | Monday, November 11, 2013 | Approved |
Chocolatey 0.9.8.22-alpha1 | 769 | Saturday, November 9, 2013 | Approved |
Chocolatey 0.9.8.21 | 4404 | Friday, November 8, 2013 | Approved |
Chocolatey 0.9.8.21-beta2 | 748 | Friday, November 8, 2013 | Approved |
Chocolatey 0.9.8.21-alpha7 | 1049 | Friday, August 23, 2013 | Approved |
Chocolatey 0.9.8.21-alpha6 | 747 | Thursday, August 22, 2013 | Approved |
Chocolatey 0.9.8.21-alpha5 | 731 | Wednesday, August 21, 2013 | Approved |
Chocolatey 0.9.8.21-alpha4 | 711 | Wednesday, August 21, 2013 | Approved |
Chocolatey 0.9.8.21-alpha3 | 887 | Tuesday, July 23, 2013 | Approved |
Chocolatey 0.9.8.21-alpha2 | 868 | Thursday, June 27, 2013 | Approved |
Chocolatey 0.9.8.21-alpha1 | 877 | Thursday, May 30, 2013 | Approved |
Chocolatey 0.9.8.20 | 331614 | Tuesday, December 11, 2012 | Approved |
Chocolatey 0.9.8.20-beta1 | 827 | Wednesday, December 5, 2012 | Approved |
Chocolatey 0.9.8.20-alpha3 | 843 | Friday, November 16, 2012 | Approved |
Chocolatey 0.9.8.20-alpha2 | 804 | Tuesday, October 16, 2012 | Approved |
Chocolatey 0.9.8.20-alpha1 | 839 | Sunday, September 16, 2012 | Approved |
Chocolatey 0.9.8.19 | 29992 | Monday, July 2, 2012 | Approved |
Chocolatey 0.9.8.19-alpha1 | 785 | Thursday, June 28, 2012 | Approved |
Chocolatey 0.9.8.18 | 2255 | Saturday, June 16, 2012 | Approved |
Chocolatey 0.9.8.17 | 1136 | Friday, June 15, 2012 | Approved |
Chocolatey 0.9.8.17-rc2 | 938 | Wednesday, June 13, 2012 | Approved |
Chocolatey 0.9.8.17-rc1 | 947 | Wednesday, June 13, 2012 | Approved |
Chocolatey 0.9.8.17-beta1 | 919 | Thursday, June 7, 2012 | Approved |
Chocolatey 0.9.8.16 | 7399 | Monday, February 27, 2012 | Approved |
Chocolatey 0.9.8.15 | 974 | Monday, February 27, 2012 | Approved |
Chocolatey 0.9.8.15-beta2 | 985 | Saturday, February 25, 2012 | Approved |
Chocolatey 0.9.8.14 | 2374 | Monday, February 6, 2012 | Approved |
Chocolatey 0.9.8.13 | 1931 | Sunday, January 8, 2012 | Approved |
Chocolatey 0.9.8.12 | 2093 | Sunday, November 20, 2011 | Approved |
Chocolatey 0.9.8.11 | 1943 | Friday, October 14, 2011 | Approved |
Chocolatey 0.9.8.10 | 1795 | Saturday, September 17, 2011 | Approved |
Chocolatey 0.9.8.9 | 1058 | Saturday, September 10, 2011 | Approved |
Chocolatey 0.9.8.8 | 914 | Saturday, September 10, 2011 | Approved |
Chocolatey 0.9.8.7 | 974 | Friday, September 2, 2011 | Approved |
Chocolatey 0.9.8.6 | 1809 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.8.5 | 956 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.8.4 | 1115 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.8.3 | 970 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.8.2 | 1172 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.8.1 | 968 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.8 | 4058 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.7.3 | 1042 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.7.2 | 1006 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.7.1 | 1000 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.7 | 1018 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.6.4 | 966 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.6.3 | 954 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.6.2 | 991 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.6.1 | 1007 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.6.0 | 980 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.5.0 | 1034 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.4.0 | 1059 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.3.0 | 1003 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.2.0 | 983 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.1.0 | 1033 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.9.0.0 | 987 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.8.0.0 | 1067 | Tuesday, August 23, 2011 | Approved |
Chocolatey 0.7.0.0 | 1390 | Tuesday, August 23, 2011 | Approved |
2017 Chocolatey Software, Inc, 2011- 2017 RealDimensions Software, LLC
See all - https://github.com/chocolatey/choco/blob/stable/CHANGELOG.md
0.10.5
BUG FIXES
- Fix - Start-ChocolateyProcessAsAdmin errors when running PowerShell scripts - see #1220
IMPROVEMENTS
- Show machine readable output with
choco outdated -r
- see #1222
0.10.4
We're dubbing this the "10-4 good buddy" release. We've added some major functionality and fixes we think you are going to find top notch - dare we say as smooth as really expensive chocolate? A lot of work for this release has been provided by the community. Remember that Chocolatey is only as good as the support that comes from the community! Be sure to thank other community members for the awesome that is Chocolatey and Chocolatey 10-4. We've closed over 30 bugs and added over 40 enhancements (75 tickets in total)!
Proxy support just got some major enhancements with the ability to not only specify proxy information at runtime, but also to set bypass lists and bypassing on local connections and configure source repositories to bypass proxies. A major issue with changing command execution timeout was just fixed. And there used to be a tiny chance you might corrupt the choco config when running multiple choco processes -but now that is much better handled.
We've also made package itself display download progress, which is great when software binaries are embedded in packages. For you folks looking to remove any progress (like when using Vagrant), now you can use --no-progress
. When NuGet.Core has issues, those issues will have more visibility into why things are failing without needing a debugging log. Speaking of some extreme visibility, see network traffic with --trace
.
We've got a few possible breaking changes that could affect you, see what we've written about them below.
This also marks the first release that uses the Chocolatey Software digital certificate for signing instead of the RealDimensions Software, LLC certificate.
Another major feature released in preview is using remembered arguments on upgrade. This is in preview in 0.10.4 and will be turned to 'on' automatically in a future release. We are going to be continually making it better and won't turn it on by default until it is ready. If you want to turn it on and start using it, once you have 0.10.4 installed, run choco feature enable -n useRememberedArgumentsForUpgrades
. You can also do this per command with --use-remembered-arguments
. You can also turn it off per command with --ignore-remembered-arguments
. We've also really described a lot of important considerations and thoughts related to using this so there are no surprises. Please do read the issue notes at length if you plan to use this feature to reduce confusion.
BREAKING CHANGES
Run with highestAvailable Execution Level by default - see #1054
One longstanding request with Chocolatey was to have it always request admin privileges before running. This has been a hope that it would cut down on the accidental runs of Chocolatey in a command shell that is not elevated and needing to open one that is elevated. This UAC (User account control) setting is handled by something called an application manifest (app.manifest). We had it set to "asInvoker", or run with the context of the user that ran the command. We've moved this to "highestAvailable", which means if you are a non-admin, it will just run under your context, but if you are an admin in a non-elevated shell, it will ask for elevated permissions to run. There is also "requireAdministrator", which locks execution down to administrators only.
Moving to "highestAvailable" allows for that asking of privileges that you are used to, up front before it runs. However one additional thing we did here was give you more control over this setting now. We used to embed the app manifest into choco.exe. We now set it next to choco.exe (base install under
$env:ChocolateyInstall
, you will findchoco.exe.manifest
) so you have more freedom to adjust those execution levels as you see fit. There is one catch, you will need to do it on every install/upgrade of Chocolatey until #1206 is implemented.When a prerelease is installed, it should upgrade to latest prerelease unless excluded - typically seen in choco upgrade all - see #686
When you run
choco upgrade all
, it never catches the prereleases. However if you runchoco upgrade all --pre
, it may upgrade some of your stable installs to prereleases. Neither of these situations are desirable. So by default, we've made it so thatchoco upgrade all
just does the right thing, which is to upgrade your stable releases to the latest stable release and your prerelease packages will upgrade to the absolute latest available, whether that be stable or prerelease. If you need to change the behavior back to the old way for upgrade all, simply add the--exclude-prerelease
option.Fix - Passing Allow Downgrade To upgrade against a prerelease may downgrade it to last stable version - see #1212
This is a bug fix that was allowing a prerelease to be downgraded accidentally to the last stable version if you ran
choco upgrade somepackage --allow-downgrade
without a particular version and without--pre
. Now while this would be less affected with #686 above, it could still happen. It's a bug. The only reason this was marked as breaking change is that someone could be depending on the buggy behavior. So heads up, this bug is now fixed. If you are attempting to downgrade, make sure you specify the version you want it to go down to.
FEATURES
- [Security][Preview] Use Remembered Arguments for a Package During Upgrades - You must opt in for this to work - see #797
- Show download progress for the packages themselves - see #1134
- Set Explicit Proxy Bypass List / Bypass On Local - see #1165
- Option/feature to stop installation when a package fails - see #1151
- Add File64 to Install-ChocolateyInstallPackage and Get-ChocolateyUnzip - see #1187
BUG FIXES
- [Security] Fix - PowerShell sees authenticode hash as changed in scripts that were signed with Unix Line Endings (
LF
) - unable to useAllSigned
- see #1203 - [Security] Fix - chocolatey setup - Use https for downloading .NET Framework 4x if not installed - see #1112
- Fix - chocolatey.config gets corrupted when multiple processes access simultaneously - see #1047
- Fix - "commandExecutionTimeoutSeconds" always reverts to 2700 when deprecated config setting is 0 - see #1059
- Fix - Allow Chocolatey version check with FIPS - see #1193
- Fix - Chocolatey doesn't always decompress downloads appropriately (support automatic decompression) - see #1056
- Fix - Load built-in Chocolatey functions, then load extensions - see #1200
- Fix - Use provided checksum type - see #1018
- Fix - MSU fails to install with space in path - see #1177
- Fix - Unable to disable failOnInvalidOrMissingLicense feature - see #1069
- Fix - PowerShell (Start-ChocolateyProcessAsAdmin) should only import the installerModule and not the profile - see #1013
- Fix - Automatic Uninstaller should skip when uninstaller executable does not exist - see #1035
- Fix - Package installation often fails with ERROR: You cannot call a method on a null-valued expression - see #1141
- Fix - Text file determination fails to throw an error because it catches it - see #1010
- Fix - Delete the .istext file before the content-type check - see #1012
- Fix - new command - don't add unparsed options as the name - see #1085
- Fix - Proxy settings ignored for local connections - see #497
- Fix - RefreshEnv / Update-SessionEnvironment changes current user to SYSTEM - see #902
- Fix - Set-EnvironmentVariable writes an error when installing Chocolatey as SYSTEM - see #1043
- Fix - Get-FtpFile fails with integer overflow when downloading file more than 2gb in size - see #1098
- Fix - Uninstall-ChocolateyPackage prints out warning if the passed file path starts and ends with quotes - see #1039
- Fix - Get-UninstallRegistryKey fixes/improvements - see #815
- Fix - Unzip specific folder feature is broken after introducing 7zip - see #676
- Fix - Join-Path error when installing Chocolatey as SYSTEM - see #1042
- Fix -
$env:OS_NAME
is 'Windows' for Windows 10 - see #1178 - Fix - choco install relativepath/to/some.nuspec fails - see #906
- Fix - When pointing to a nupkg, choco should use only that nupkg to install and not a newer version in the same directory - see #523
- Fix - Automatic uninstaller should split by quotes when necessary - see #1208
- [API] Fix - lib should merge the AlphaFS dependency - see #1148
- [API] Fix - don't reset loggers on setting custom automatically - see #1121
- [API] Fix - Chocolatey file cache adds a 'chocolatey' directory on each install - see #1210
- [API] Fix - Getting Local List of Package may leave config in undesirable state - see #1213
- Fix - Pro/Business - Chocolatey Licensed Feed May Show Up More Than Once - see #1166
- Fix - Pro/Business - Synchronized packages with DLLs are attempted to be imported by Chocolatey's PowerShell Extensions Loader - see #1041
IMPROVEMENTS
- [Security] Username and password for
choco apikey
not encrypted in output - see #1106 - [Security] Sign Binaries / Authenticode Signatures with Chocolatey Software digital certificate - see #1214
- Setting commandExecutionTimeout to 0 means never time out - see #1202
- Configure sources to skip proxy - see #262
- Set proxy information at runtime - see #1173
- Start-ChocolateyProcessAsAdmin should not elevate when already elevated - see #1126
- Add
--no-progress
cli switch for hidding progress bars - see #917 - Note web status errors on package install failures - see #1172
- Always let Nuget.Core log - see #1095
- Make choco get its proxy settings also from environment variables - see #605
- Remove quotes in process passed to Start-ChocolateyProcessAsAdmin / CommandExecutor - see #1167
- Increase download buffer size in Get-FtpFile to speed up downloads - see #1099
- Trace network traffic - see #1182
- Upgrade 7Zip to 16.04 - see #1184
- Do not create .ignore file if outside of Chocolatey location - see #1180
- Help should exit zero if called with the help switch, otherwise non-zero on bad commands - see #473
- "Licensed messages" may address users in a somewhat unprofessional manner - see #1111
- Show the entire text to turn on the allowGlobalConfirmation flag - see #1053
- Running
choco
should produce name/version and further instructions - see #1083 - Typo in Install-ChocolateyPowershellCommand - see #1088
- Update
choco new pkg
template to give example of handling nested quoted paths - see #1067 - Add Aliases for Install-ChocolateyVsixPackage - see #1146
- Add Chocolatey Software to copyright - see #1209
- Pro/Business - Feature to Disable Non-Elevated Warnings - see #1118
- Pro/Business - Package Throttle - Bitrate limit packages and downloads (support) - see #454
- Pro/Business - Allow version overrides for local packages - see #942
- Pro/Business - List include programs should not show items from Package Synchronizer's Programs and Features Package Sync - see #1205
- Pro/Business - Show better messaging when unable to load licensed assembly - see #1145
- Pro/Business - PowerShell Functions should allow overriding urls - see #1117
- Pro/Business - Automatic Uninstaller - allow remove directly - see #1119
- Pro/Business - Add Chocolatey Architect edition license SKU - see #1075
- Pro/Business - Ensure sync command can be machine parseable - quiet logging - see #1147
- Pro/Business - Configure a source to be allowed for self-service - see #1181
0.10.3
BREAKING CHANGES
- Fix - Do Not Check
$LastExitCode
- Only error a package install if script errors or set a different exit code when it is specifically set - see #1000
Starting in v0.9.10, Chocolatey started checking $LASTEXITCODE
in addition to the script command success as a way to be more helpful in determining package failures. This meant it offered the ability to capture when a script exited with Exit 1
and handle that accordingly. However that really has never been a recommended scenario for returning errors from scripts and is not seen in the wild anywhere so it is believed that those that may be affected are very few.
Checking $LastExitCode
checks the last executable's exit code when the script specifically does not call Exit
(which is . This can lead to very perplexing failures, such as running a successful xcopy that exits with 2
and seeing package failures without understanding why. Since it is not typically recommended to call Exit
to return a value from PowerShell because of issues with different hosts, it's less of a concern to only look at explicit failures. For folks that may need it, allow failing a package again by the last external command exit code or exit
from a PowerShell script. Note that it is not recommended to use exit with a number to return from PowerShell scripts. Instead you should use $env:ChocolateyExitCode
or Set-PowerShellExitCode
(first available in v0.9.10) to ensure proper setting of the exit code.
If you need the prior behavior, please turn on the feature scriptsCheckLastExitCode
.
BUG FIXES
- Fix - chocolateybeforemodify runs after modifying (moving) chocolatey lib package files - see #995
- Fix - The refreshenv command throws an error about Write-FunctionCallLogMessage when ran in PowerShell on 0.10.2 - see #996
0.10.2
We're dubbing this the "Every Joe" release in honor of a friend that just lost his fight with brain cancer. If you want to help further research, please make a donation to a cancer research association of your choosing (e.g. the American Brain Tumor Assocation).
A couple of important fixes/enhancements in this release. Most of the improvements are about providing better feedback to you and fixing minor issues. The big one surrounds when packages set a download path for a file using $env:TEMP
, choco will ensure that the file can still be found for later use.
BUG FIXES
- Fix - Downloaded file is at old
$env:TEMP\chocolatey\chocolatey
location, but install calls with just$env:TEMP\chocolatey\
location - see #969 - Fix - [Pro/Business] UseOriginalLocation fails when there is no 64bit file - see #972
- Fix - Do not use unparsed options as package names - see #983
IMPROVEMENTS
- Start-ChocolateyProcessAsAdmin enhancements - see #977
- Log PowerShell function calls better - see #976
- Allow environment variables in some config settings - see #971
- [Pro/Business] Provide license type to environment variables - see #968
- Note that chocolateyUninstall.ps1 may no longer required in template - see #982
- Provide guidance when licensed only options are passed to FOSS - see #984
- Rollback automatically when a user cancels an operation - see #985
- Explain how to workaround a failing uninstall - see #573
- Remove extra forward slashes in url - see #986
- Side by side uninstall enhancements - see #992
0.10.1
We're dubbing this the "Shhh! Keep that secret please" release. We've found that when passing in passwords and other sensitive arguments, those items can end up in the logs in clear text. We've addressed this in #948 and #953. When it comes to passing sensitive arguments through to native installers, you can set up environment variables with those sensitive args and pass those arguments directly through to Start-ChocolateyProcessAsAdmin
. If you prefer a better experience, the licensed version allows passing sensitive options directly through choco.exe as --install-arguments-sensitive
and --package-parameters-sensitive
. Read more in the Licensed CHANGELOG.
Perhaps the biggest improvement in this release is that Chocolatey will automatically look to see if it can download binaries over HTTPS when provided an HTTP url. If so, Chocolatey will switch to downloading the binaries over SSL. This provides better security in downloading and knowing you are getting the binary from the source location instead of a possible man in the middle location, especially when the package does not provide checksums for verification.
Another improvement you may not even notice, but we think you will love is that Chocolatey now supports TLS v1.2 transport which presents a nice transparent increase in security. You will need to have at least .NET Framework 4.5 installed to take advantage of this feature.
FEATURES
- [Security] Support TLS v1.2 - see #458
- [Security] Attempt to download packages via HTTPS connection - see #746
- [Security] Pro/Business - Pass sensitive arguments to installers - see #948
- Search (and info) by version - see #935
BUG FIXES
- [Security] Fix - Passwords in command line options are logged in clear text - see #953
- [Security] Fix - For PowerShell v2 - if switch down to SSLv3 protocol fails, go back to original protocol - see #958
- Fix - Unzipping to ProgramFiles/System32 is Subject to File System Redirection - see #960
- Fix - Run without login - see #945
- Fix - Support Long Paths - see #934
- Fix - help should not issue warning about elevated command shell - see #893
- Fix - Licensed Feed cannot be disabled - see #959
- Fix - Choco with unknown command should show help menu - see #938
- Fix - Get-FtpFile error when file is missing (called through Get-ChocolateyWebFile) - see #920
- Fix - Skip Get-WebFileName for FTP - see #957
- Fix - Chocolatey-InstallChocolateyPackage fix for double chocolatey folder name is not also applied to the passed in file name - see #908
- Fix - Start-ProcessAsAdmin - working directory should be from the location of the executable - see #937
- [POSH Host] Fix - PowerShell Host - Package scripts setting values can affect packages that depend on them - see #719
- Fix - Transactional install - pending check may fail if the lib folder doesn't exist - see #954
- Fix - Start-ChocolateyProcessAsAdmin Module Import for PowerShell causes errors - see #901
IMPROVEMENTS
- Transactional Install - Improve concurrent operations (pending) - see #943
- Uninstall-ChocolateyPackage should set unrecognized fileType to exe - see #964
- Powershell functions - Allow access to package title, not only ID - see #925
- Option to apply package parameters / install arguments to dependent packages - see #839
- Get-ChocolateyWebFile download check enhancements - see #952
- Do not treat unknown checksum types as MD5 - see #932
- Pro/Business - Install-ChocolateyPackage - UseOriginalLocation - see #950
- Auto determine checksum type - see #922
- Ensure PowerShell functions have parameter name parity - see #941
- Output from installer should go to verbose log - see #940
0.10.0
What was planned for 0.9.10.4 is now 0.10.0. This is due partly to a breaking change we are making for security purposes and a move to provide better a better versioning scheme for the remainder of the sub-v1 versions of Chocolatey. Instead of 0.y.z.0 being considered where major verions occur in the sub 1 series, 0.y.0 will now be considered where those major versions occur. We also are moving right along towards v1 (and hope to be there in 2017).
0.10.0 carries the fixes for 0.9.10.4 and includes a major security enhancement (checksum requirement).
BREAKING CHANGES
- [Security] Checksum requirement and enhancements - see #112
Checksums in package scripts are meant as a measure to validate the originally intended downloaded resources used in the creation of a package are the same files that are received at a future date. This also ensures that the same files that are checked by all parts of moderation (if applicable) are the same files that are received by users for a package. This is seen mostly on the community repository because it is public and packages are subject to copyright laws (distribution rights), which typically requires the package scripts to download software from the official distribution locations. The Chocolatey framework has had the ability to use checksums in package scripts since July 2014.
What is the requirement? choco will now fail if a package download resources from HTTP/FTP and does not use checksums to verify those downloaded resources. The requirement for HTTP/FTP is #112. We are considering also requiring it for HTTPS (#895) as well. You can optionally set a feature (allowEmptyChecksumsSecure
) to ensure packages using HTTPS also use checksums.
How does this protect the community anymore than before? During moderation review, there is a check of these downloaded binaries against VirusTotal (which verifies these binaries against 50-60+ different virus scanners). The binaries are also verified for installation purposes against a test computer. With an independent 3rd party checksum in the package itself, it guarantees that the files received by a user from those remote sources are the exact same files that were used in the verification process.
Why the requirement, and why now? This is a measure of protection for the Chocolatey community. HTTP is easy to hack with both DNS poisoning and MITM (man in the middle) attacks. Without independent verification of the integrity of the downloaded resources, users can be left susceptible to these issues. We've been planning a move to require checksums for awhile now, with a planned longer and smoother transition for package maintainers to get packages updated to reduce breakages. Unfortunately there was a recent event with FOSSHub getting hacked (the community repository had 8 possibly affected packages and we quickly took action), which necessitated a need for us to move in a much swifter fashion to ensure the protection of the community sooner, rather than later. The changes in Chocolatey represented by the checksum changes are a major step in the process to ensure protection. Requiring for HTTPS as well will mitigate any future compromises of software distribution sites that are used with Chocolatey packages.
Can I shut this behavior off or opt out per package?
You can shut off the checksum requirement by enabling the feature allowEmptyChecksums
. This will return Chocolatey to previous behavior. We strongly recommend against it.
You can shut it off or turn it per package install/upgrade with --allow-empty-checksums
and --require-checksums
, respectively. See https://chocolatey.org/docs/commands-install / https://chocolatey.org/docs/commands-upgrade.
You can also disable the feature allowEmptyChecksumsSecure
to enforce checksums for packages that download from secure locations (HTTPS).
Other things I should know? Users also now have the ability to pass their own checksums and checksumtypes into the install. See https://chocolatey.org/docs/commands-install / https://chocolatey.org/docs/commands-upgrade.
KNOWN ISSUES
FEATURES
- Pro/Business - Download a package without installing it - see #108
BUG FIXES
- Fix - Installing choco on Windows 10 Vagrant box stops Vagrant from being able to manage the box - see #834
- Fix - 64bit 7z.exe on 32bit system in chocolatey\tools - see #836
- Fix - [POSH Host] PowerShell exit code does not reset between packages in a single run - see #854
- Fix - Uninstall-ChocolateyZipPackage is failing - see #871
- Fix - "C:\Program Files\WindowsPowerShell\Modules" is missing in PSModulePath for cmd.exe #830
- Fix - Environment variables update fixes #840
- Fix - Handle null items better - see #853
- Fix - HKCU may not have Environment (Install of Chocolatey) - see #375
- Fix - Progress of download does not clear the whole output line - see #875
- Fix - Wrong download progress reported during package upgrade - see #872
- Fix - Uninstall not supporting side-by-side => ChocolateyUninstall.ps1 not run - see #862
- Fix - Uninstall ignores the version parameter - see #861
- Fix - Search by exact or by id only is case sensitive for remote sources - see #889
- Fix - Deprecated links inserted in .nuspec files created by
choco new ...
- see #870 - Fix - Get-OSArchitectureWidth doesn't do what it says it does - see #828
- Fix - When Choco fails to get a package from NuGet Core, fail the package with exit code 1 - see #867
- Fix - Illegal characters in path - see #857
- Fix - Get-OSArchitectureWidth doesn't do what it says it does - see #828
- Fix - Pro/Business - Choco install config file fails on licensed assembly - see #866
- Fix - DISM /all doesn't run anywhere but Windows 6.2 -- no dependencies get installed - see #897
IMPROVEMENTS
- Do not install tab completion (edit of profile) under certain conditions - see #833
- Choco install with packages.config should print out the packages to install - see #878
- Larger default log file size and retention - see #852
- Allow getting installer type to be overridden - see #885
- Pack - Add optional output folder option - see #598
- Little command name correction on init.ps1 - see #595
- Tab completion - don't query if there is a file in the folder that meets completion - see #847
0.9.10.3
BUG FIXES
- Fix - Ignore ValidPackage Exit Codes for Real - see #827
- Fix - Cache folder running under SYSTEM account should be C:\Windows\TEMP - see #826
- Fix - Built-in 7zip doesn't behave properly - see #775
- Fix - Successful installer exit codes not recognized by choco should return 0 - see #821
- Fix - NotSilent fails with "Cannot bind argument to parameter statements because it is an empty string" - see #819
- Fix - Silent Args being passed as a string array cause package failure - see #808
IMPROVEMENTS
- Hold pending check for 10 seconds / provide means of explicitly overriding the transactional install cleanup - see #822
- Pro/Business - Add runtime skip option to allow skipping the virus scanner - see #786
0.9.10.2
BUG FIXES
- Fix - Chocolatey Licensed is unable to find 0.9.10.x (only 0.9.10.0) - see #814
- Fix - Logging is broken in some packages due to new TEMP directory - see #813
- [API] Fix - When performing an Install/Uninstall/Upgrade operation through the API, an error is throw for "chocolatey.resources" - see #811
IMPROVEMENTS
- Ensure log file path exists - and fix the log file arguments if necessary - see #758
0.9.10.1
BUG FIXES
- Fix - Cannot bind argument to parameter 'exitCode' because it is null - see #810
IMPROVEMENTS
- [Security] Upgrade to 7zip 16.02 to overcome CVE-2016-2334/CVE-2016-2335 - see #812
0.9.10
The "I got 99 problems, but a package manager ain't one" release. With the release of 0.9.10 (or if you prefer 0.9.10.0), we're about to make everything 100% better in your Windows package management world. We've addressed over 100 features and bugs in this release. We looked at how we could improve PowerShell and we've come out with a competely internal host that can Prompt and Read-Host in a way that times out and selects default values after a period of time. Speaking of PowerShell, how about some tab completion choco <tab>
to choco install node<tab>
? How about never having to close and reopen your shell again?
Alternative sources (-source webpi
, -s windowsfeature
, etc) are back! I mean, am I right?! Have you heard of auto uninstaller? If Chocolatey has installed something that works with Programs and Features, Chocolatey knows how to uninstall it without an uninstall script about 90+% of the time. This feature was in beta for the 0.9.9 series, it is on by default in 0.9.10 (unless you disabled it after trying it, you will need to reenable it, see choco feature
for more details).
Here's one you probably never knew existed - extensions. Chocolatey has had the ability to extend itself by adding PowerShell modules for years, and most folks either didn't know it existed or have never used them. We've enhanced them a bit in preparation for the licensed version of Chocolatey.
We redesigned our choco new
default packaging template and we've made managing templates as easy as managing packages.
choco search
/choco list
has so many enhancements, you may not need to visit dot org again. See it in action.
- search -v provides moderation related information and a world of nuspec information
- search by id only
- search by id exact
- search by approved only, not broken, and/or by download cache
- sort by version
- search with paging
There are 150 tickets closed for this release! We've included remediation steps for when a breaking change affects you. Mostly if you have been using Chocolatey in a recommended way, you won't even notice any adverse changes. There are a number of things we thought to highlight, and quite a few security enhancements coming in this release (look for the [Security] tag on the ticket summary).
BREAKING CHANGES
- Only fail automation scripts (chocolateyInstall.ps1) if the script returns non-zero exit code - see #445
The 0.9.8 series would only fail a package with terminating errors. The 0.9.9 series took that a bit further and started failing packages if anything wrote to stderr. It turns out that is a bad idea. Only when PowerShell exits with non-zero (which comes with terminating errors) should the package fail due to this. If you need the old behavior of the 0.9.9 series, you can get it back with a switch (--fail-on-standard-error
and its aliases) and/or a feature flip (failOnStandardError
).
- Fix - Force reinstall, force upgrade, and uninstall should delete the download cache - see #590
If you set a custom cache directory for downloads, it will no longer use a "chocolatey" subdirectory under that. You may need to make any adjustments if this is going to affect you.
- Exit with the same exit code as the software being installed - see #512
There are more exit codes from Chocolatey now that indicate success -0
, 1605
, 1614
, 1641
, and 3010
. You may need to adjust anything you were using that would only check for 0 and nonzero.
If you need the previous behavior, be sure to disable the feature usePackageExitCodes
or use the --ignore-package-exit-codes
switch in your choco commands.
- PowerShell module functions adjusted for automatic documentation - see #697
If you were using any of the functions in a non-recommended way or not compliant with the examples, you are going to find breakages in the functions as some of the things that were called out as non-optional are now enforced. This shouldn't affect most folks.
- [Security] Explicit permissions - remove inheritance/lock down to admins - see #398
This further restricts the default installation location by removing all permissions and inheritance of permissions, explicitly giving Administrator/LocalSystem to Full access, and Users are granted Read and Execute. In prior installations, we ensured Modify access to the installing user, but that has been removed for security reasons. Should you need the previous behavior, set $env:ChocolateyInstallAllowCurrentUser="true"
.
KNOWN ISSUES
FEATURES
- Alternative Sources - see #14
- [POSH Host] Use Internal PowerShell Host - see #8
- Run a script before uninstall/upgrade (chocolateyBeforeModify.ps1) to allow for things like services to shutdown - see #268
- Manage package templates with a specially named package and special package folder - see #542
- Support for custom headers - see #332
- [Security] Show moderation-related information in search results - see #493
- New Helper - Get-ToolsLocation helper (replacement for Get-BinRoot) - see #631
- Choco list/search should have exact filter search - see #453
- RefreshEnv (Refresh Environment Variables) Should also work in PowerShell - see #664
- Provide PowerShell tab completion for Chocolatey - see #412
- [Security] Sign the powershell scripts and assemblies - see #501
- Add a
choco info
command to show info for one package - see #644 - Mark packages pending until install completes successfully - see #198
- Resolve sources by name - see #356
- Uninstall-ChocolateyEnvironmentVariable function - see #772
- Get-UninstallRegistryKey function - see #739
- Pro/Business - Ubiquitous Install Directory Switch - see #258
- Pro/Business - Runtime Virus Scanning - see virus scanning
- Pro/Business - Private CDN cache for downloads - see private CDN cache
- Pro/Business - Sync "choco installed status" with "Windows installed status" - see #567
BUG FIXES
- [Security] Fix - Only load the Chocolatey PowerShell module from a known location - see #560
- [Security] Fix - Package source authentication at http://location/path doesn't also use http://location/ (base url) - see #466
- [Security] Fix - When defining a proxy without credentials - proxy password is shown in plain text - see #503
- [Security] Fix - Fully qualify shutdown command - see #702
- [Security] Fix - MSI packages fail install with
Could not find 'msiexec'
- see #723 - Fix - Force should set allow-downgrade to true - see #585
- Fix - Do not use NuGet package cache - see #479
- Fix - Pack doesn't include chocolatey-specific metadata - see #607
- Fix - TEMP environment variable is 8.3 Path on some systems - see #532
- Fix -
$packageName
should be present for zip uninstalls in uninstall script template - see #534 - Fix - Debug/Verbose messages not logged in automation scripts (chocolateyInstall.ps1) - see #520
- Fix - Escape log output for variables that have data from external sources - see #565
- Fix - Choco new silentargs can't pass in args in the param=value format - see #510
- Fix - Exception if no source is enabled - see #490
- Fix - Chocolatey command help output written to standard error instead of standard out - see #468
- Fix - Logger doesn't clear cached NullLoggers - see #516
- Fix - DISM "/All" argument in the wrong position - see #480
- Fix - Pro - Installing/uninstalling extensions should rename files in use - see #594
- Fix - Running Get-WebFileName in PowerShell 5 fails and sometimes causes package errors - see #603
- Fix - Merging assemblies on a machine running .Net 4.5 or higher produces binaries incompatible with .Net 4 - see #392
- Fix - API - Incorrect log4net version in chocolatey.lib dependencies - see #390
- [POSH Host] Fix - Message after Download progress is on the same line sometimes - see #525
- [POSH Host] Fix - PowerShell internal process - "The handle is invalid." - see #526
- [POSH Host] Fix - The handle is invalid - when output is being redirected and a package attempts to write to a filestream - see #572
- [POSH Host] Fix - Write-Host adding multiple line breaks - see #672
- [POSH Host] Fix - PowerShell Host doesn't show colorization overrides - see #674
- [POSH Host] Fix - $profile is empty string when installing packages - does not automatically install the ChocolateyProfile - see #667
- [POSH Host] Fix - Getting LCID doesn't work properly with the built-in PowerShell - see #741
- [POSH Host] Fix - Host.Version should return actual PowerShell version - see #708
- Fix - Verbose shows in output on debug switch - see #611
- Fix - Get-ChocolateyUnzip captures files that don't belong to the package / Unzip should not do a full disk scan - see #616 and #155
- Fix - Package succeeds but software install silently fails when Install-ChocolateyInstallPackage has the wrong arguments - see #629
- Fix - ShimGen handling of spaces and arguments that have shimgen in them - see #647
- Fix - PowerShell v2 - Choco installer messages can't actually be warnings (causes FileStream errors) - see #666
- Fix - Installing chocolatey removes $env:PSModulePath changes for current PowerShell session - see #295
- Fix - Notice for Get-BinRoot deprecation won't be displayed - see #673
- Fix - choco new creates a bad ChocolateyUninstall.ps1 script which does not work. - see #460
- Fix - ShimGen fails when file metadata has strings that need literals - see #677
- Fix - Install-ChocolateyPath Expands Variables in PATH, Overwriting Preexisting Variables - see #303
- Fix - Install-ChocolateyShortcut gives invalid warning when target is a web url - see #592
- Fix - Argument Parsing failures should be reported as warnings and not debug messages - see #571
- Fix - choco pack returns zero exit code when Nuget.Core validation errors - see #469
- Fix -
Install-ChocolateyPath
updatesPATH
toREG_SZ
, which may break using Windows dir and system32 tools - see #699 - Fix - Removing environment variables sets empty environment variables - see #724
- Fix - Environment Variable Changes Require Reboot - see #728
- Fix - Get-WebFileName determines strange file name - see #727
- Fix - Package params are also applied to dependent package - see #733
- Fix - Use package name/version from environment, not parameters - see #751
- Fix - Get-WebFileName Does Not Match on Invalid Characters - see #753
- Fix -
choco new
cannot introduce multistage folder hierarchy template - see #706 - Fix - Empty $env:ChocolateyToolsLocation combine error - see #756
- Fix - Installing chocolatey removes $env:PSModulePath changes for current powershell session - see #295
- Fix - Some environment variables are set too early for options/switches to have an effect - see #620
- [API] Fix - Issue when attempting to execute run command through API - see #769
- Fix - Logging of upgrade messages - placement of some messages is incorrect - see #557
- Fix - Get-WebFile fails with - The term '//continue' is not recognized as the name of a cmdlet - see #789
- Fix - Unable to read registry snapshot file - see #487
- Fix - Pro/Business - Licensed version has an incorrect dependency on PowerShell assemblies and will only load v3 and above - see #799
- Fix - Exit codes in package scripts should work - see #802
- Fix - Running choco new creates a bad nuspec - see #801
IMPROVEMENTS
- AutoUninstaller is on by default - see #308
- Use the actual download file name instead of providing one - see #435
- Unset Configuration Values - see #551
- Ability to run "choco upgrade all" ignoring specific packages - see #293
- Extensions enhancements - see #588
- Show human-readable file sizes when downloading - see #363
- [Security] Warn about environment changes - see #563
- Warn when execution timeout has elapsed - see #561
- Update nuspec to make it easier to get started - see #535
- Suppress verbose output to verbose - like with 7-zip - see #476
- Choco push moderation message only on push to dot org - see #601
- Allow tools/bin root to be root of the drive again - see #628
- File description of ShimGen shims should match original as closely as possible - see #374
- Shim Generation should automatically detect GUI - see #634
- Don't show 32 bit wording unless there is explicitly both versions available - see #642
- Allow passing arbitrary key/value arguments to new command when generating packages from templates - see #658
- Choco search/list should be able to search just by Id - see #663
- Search by approved, by not broken, by download cache - see #670
- Save nuspec files with package installs - see #623
- Show a prompt character when asking a multiple choice question - see #184
- When prompting for a user yes/no answer, use a short [y/n] representation - see #181
- Default package template should include LICENSE.txt and VERIFICATION.txt for packages with binaries - see #675
- choco list/search aliases for -v - '-detail' and '-detailed' - see #646
- Log normal output to a secondary log - see #682
- Display Package test status information on install/upgrade - see #696
- Report when reboots are necessary from package installs - see #712
- Report loaded extensions - see #715
- Exit with specific codes on certain actions - see #707
- Determine if Downloaded File is HTML or Plain Text - see #649
- Interactively prompt with timeout on some questions - see #710
- [POSH Host] Exit code from PowerShell Host should be useful - see #709
- Update environment for scripts after setting environment variables - see #729
- Clean up any temp nuget folder actions after NuGet operations - see #622
- Ensure Web Requests and Responses Do Not Timeout - make configurable - see #732
- Combine timeout from push and execution timeout as one parameter - see #752
- Override autouninstaller / failonautouninstaller fail with switches for uninstall - see #515
- Offer to remove actual package (.install/.portable) when removing meta/virtual package - see #735
- Provide more info in package summary - see #455
- Report install location - see #689
- Track MSI Information Better - see #755
- Support for client certificates - see #399
- choco feature list formatting enhancements - see #742
- choco new --original-template - see #737
- Update Get-FtpFile with fixes for Get-WebFile - see #765
- Rename Get-ProcessorBits as a more appropriately named Get-OSArchitectureWidth - see #713
- Allow passing no 32-bit url and fail the package on 32-bit systems - see #527
- Enhance Install-ChocolateyShortcut to support WindowStyle, Pin to Taskbar and Run As Administrator checkbox - see #519
- [Security] Allow hashing files for checksums with FIPS compliant algorithms - see #446
- After upgrading provide summary of upgraded packages - see #759
- Web functions - Check for local file and return early - see #781
- Refresh environment variables after each install - see #439
- Capture Arguments for a Package during Install/Upgrade - see #358
- If config update fails, log to debug instead of warn - see #793
- Remove extra empty lines when doing choco upgrade all - see #796
- Mention required permissions if user has no access - see #794
- Pro/Business - Also check for license in User Profile location - see #606
- Pro/Business - Set download cache information if available - see #562
- Pro/Business - Allow commands to be added - see #583
- Pro/Business - Load/Provide hooks for licensed version - see #584
- Pro/Business - On valid license, add pro/business source automatically - see #604
- Pro/Business - Add switch to fail on invalid or missing license - see #596
- Pro/Business - add ignore invalid switches/parameters - see #586
- Pro/Business - Don't prompt to upload file for virus scanning if it is too large - see #695
- Pro/Business - add 'support' command - see #745
- Pro/Business - Adjust environment settings warning to suggest upgrade - see #795
- API - Add the ability to retrieve package count for a Source - see #431
- API - Chocolatey Lib still marks vital package information as internal - see #433
- API - Add paging to list command - see #427
- API - Choco search should sort by version - see #668
- API - Switch dll to .NET Client Profile - see #680
This package has no dependencies.
Ground Rules:
- This discussion is only about Chocolatey and the Chocolatey package. If you have feedback for Chocolatey, please contact the Google Group.
- This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
- The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
- Tell us what you love about the package or Chocolatey, or tell us what needs improvement.
- Share your experiences with the package, or extra configuration or gotchas that you've found.
- If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.