前回のつづき。WinXPにてGtkmm3環境をつくるため、MinGW環境が必要らしい。 MinGWを入手するために、chocolateyをインストールしたログ。
chocolatey
g++コマンドがほしい。 yumコマンドでインストールできるっぽい。
http://www.task-notes.com/entry/20151114/1447492231
windowsでyumコマンドに該当するのはchocolateyらしい。
http://pc.thejuraku.com/windows%E7%94%A8%E3%81%AEyum-apt-get-chocolaty/3409/
PowerShell
PowerShellが必要らしい。 WindowsXPはインストールが必要だったような気がする。 遠い昔、インストールした気がする。
参考
http://www.atmarkit.co.jp/ait/articles/1003/11/news090_3.html
http://d.hatena.ne.jp/torazuka/20110419/ps
バージョン確認
PS C:\> $PSVersionTable
Name Value
---- -----
CLRVersion 2.0.50727.3655
BuildVersion 6.0.6002.18111
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1
1.0には「$PSVersionTable」が存在しないらしい。 エラーが出たら1.0かも。
chocolateyインストール
手順どおりコマンドを打った結果。
C:\root\downloads>@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex (
(New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install
.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2016/09/16 7:53 chocInstall
Getting latest version of the Chocolatey package for download.
Downloading https://chocolatey.org/api/v2/package/chocolatey/0.10.0 to C:\DOCUM
E~1\ADMINI~1\LOCALS~1\Temp\chocolatey\chocInstall\chocolatey.zip
Download 7Zip commandline tool
Downloading https://chocolatey.org/7za.exe to C:\DOCUME~1\ADMINI~1\LOCALS~1\Tem
p\chocolatey\chocInstall\7za.exe
Extracting C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\chocolatey\chocInstall\chocolatey
.zip to C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\chocolatey\chocInstall...
7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
Processing archive: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\chocolatey\chocInstall\ch
ocolatey.zip
Extracting _rels\.rels
Extracting chocolatey.nuspec
Extracting tools\chocolateyInstall.ps1
Extracting tools\chocolateysetup.psm1
Extracting tools\init.ps1
Extracting tools\chocolateyInstall\choco.exe
Extracting tools\chocolateyInstall\choco.exe.ignore
Extracting tools\chocolateyInstall\LICENSE.txt
Extracting tools\chocolateyInstall\helpers\chocolateyInstaller.psm1
Extracting tools\chocolateyInstall\helpers\chocolateyProfile.psm1
Extracting tools\chocolateyInstall\helpers\chocolateyScriptRunner.ps1
Extracting tools\chocolateyInstall\helpers\ChocolateyTabExpansion.ps1
Extracting tools\chocolateyInstall\helpers\functions\Format-FileSize.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-CheckSumValid.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-ChocolateyUnzip.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-ChocolateyWebFile.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-EnvironmentVariable.ps
1
Extracting tools\chocolateyInstall\helpers\functions\Get-EnvironmentVariableNam
es.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-FtpFile.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-OSArchitectureWidth.ps
1
Extracting tools\chocolateyInstall\helpers\functions\Get-ToolsLocation.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-UACEnabled.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-UninstallRegistryKey.p
s1
Extracting tools\chocolateyInstall\helpers\functions\Get-VirusCheckValid.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-WebFile.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-WebFileName.ps1
Extracting tools\chocolateyInstall\helpers\functions\Get-WebHeaders.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-BinFile.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyDesktopL
ink.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyEnvironm
entVariable.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyExplorer
MenuItem.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyFileAsso
ciation.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyInstallP
ackage.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyPackage.
ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyPath.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyPinnedTa
skBarItem.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyPowershe
llCommand.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyShortcut
.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyVsixPack
age.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-ChocolateyZipPacka
ge.ps1
Extracting tools\chocolateyInstall\helpers\functions\Install-Vsix.ps1
Extracting tools\chocolateyInstall\helpers\functions\Set-EnvironmentVariable.ps
1
Extracting tools\chocolateyInstall\helpers\functions\Set-PowerShellExitCode.ps1
Extracting tools\chocolateyInstall\helpers\functions\Start-ChocolateyProcessAsA
dmin.ps1
Extracting tools\chocolateyInstall\helpers\functions\Test-ProcessAdminRights.ps
1
Extracting tools\chocolateyInstall\helpers\functions\Uninstall-BinFile.ps1
Extracting tools\chocolateyInstall\helpers\functions\Uninstall-ChocolateyEnviro
nmentVariable.ps1
Extracting tools\chocolateyInstall\helpers\functions\Uninstall-ChocolateyPackag
e.ps1
Extracting tools\chocolateyInstall\helpers\functions\UnInstall-ChocolateyZipPac
kage.ps1
Extracting tools\chocolateyInstall\helpers\functions\Update-SessionEnvironment.
ps1
Extracting tools\chocolateyInstall\helpers\functions\Write-ChocolateyFailure.ps
1
Extracting tools\chocolateyInstall\helpers\functions\Write-ChocolateySuccess.ps
1
Extracting tools\chocolateyInstall\helpers\functions\Write-FileUpdateLog.ps1
Extracting tools\chocolateyInstall\redirects\choco.exe
Extracting tools\chocolateyInstall\redirects\choco.exe.ignore
Extracting tools\chocolateyInstall\redirects\chocolatey.exe
Extracting tools\chocolateyInstall\redirects\chocolatey.exe.ignore
Extracting tools\chocolateyInstall\redirects\cinst.exe
Extracting tools\chocolateyInstall\redirects\cinst.exe.ignore
Extracting tools\chocolateyInstall\redirects\clist.exe
Extracting tools\chocolateyInstall\redirects\clist.exe.ignore
Extracting tools\chocolateyInstall\redirects\cpack.exe
Extracting tools\chocolateyInstall\redirects\cpack.exe.ignore
Extracting tools\chocolateyInstall\redirects\cpush.exe
Extracting tools\chocolateyInstall\redirects\cpush.exe.ignore
Extracting tools\chocolateyInstall\redirects\cuninst.exe
Extracting tools\chocolateyInstall\redirects\cuninst.exe.ignore
Extracting tools\chocolateyInstall\redirects\cup.exe
Extracting tools\chocolateyInstall\redirects\cup.exe.ignore
Extracting tools\chocolateyInstall\redirects\cver.exe
Extracting tools\chocolateyInstall\redirects\cver.exe.ignore
Extracting tools\chocolateyInstall\redirects\RefreshEnv.cmd
Extracting tools\chocolateyInstall\tools\7z.dll
Extracting tools\chocolateyInstall\tools\7z.exe
Extracting tools\chocolateyInstall\tools\7z.exe.ignore
Extracting tools\chocolateyInstall\tools\7z.exe.manifest
Extracting tools\chocolateyInstall\tools\7zip.license.txt
Extracting tools\chocolateyInstall\tools\checksum.exe
Extracting tools\chocolateyInstall\tools\checksum.exe.config
Extracting tools\chocolateyInstall\tools\checksum.exe.ignore
Extracting tools\chocolateyInstall\tools\checksum.license.txt
Extracting tools\chocolateyInstall\tools\detector.zip
Extracting tools\chocolateyInstall\tools\shimgen.exe
Extracting tools\chocolateyInstall\tools\shimgen.exe.ignore
Extracting tools\chocolateyInstall\tools\shimgen.license.txt
Extracting package\services\metadata\core-properties\b71b0b2f574b4729aa21344771
28b378.psmdcp
Extracting [Content_Types].xml
Everything is Ok
Files: 87
Size: 11599385
Compressed: 6894450
Installing chocolatey on this machine
Creating ChocolateyInstall as an environment variable (targeting 'Machine')
Setting ChocolateyInstall to 'C:\Documents and Settings\All Users\Application
Data\chocolatey'
WARNING: It's very likely you will need to close and reopen your shell
before you can use choco.
警告: Failure attempting to let Explorer know about updated environment
settings.
用語 'C:\WINDOWS\System32\setx.exe' は、コマンドレット、関数、スクリプト
ファイル、または操作可能なプログラムの名前として認識されません。名前が正しく記
述されていることを確認し、パスが含まれている場合はそのパスが正しいことを確認し
てから、再試行してください。
WARNING: Installation folder is not the default. Not changing permissions. Pleas
e ensure your installation is secure.
We are setting up the Chocolatey package repository.
The packages themselves go to 'C:\Documents and Settings\All Users\Application
Data\chocolatey\lib'
(i.e. C:\Documents and Settings\All Users\Application Data\chocolatey\lib\you
rPackageName).
A shim file for the command line goes to 'C:\Documents and Settings\All Users\A
pplication Data\chocolatey\bin'
and points to an executable in 'C:\Documents and Settings\All Users\Applicati
on Data\chocolatey\lib\yourPackageName'.
Creating Chocolatey folders if they do not already exist.
WARNING: You can safely ignore errors related to missing log files when
upgrading from a version of Chocolatey less than 0.9.9.
'Batch file could not be found' is also safe to ignore.
'The system cannot find the file specified' - also safe.
chocolatey.nupkg file not installed in lib.
Attempting to locate it from bootstrapper.
PATH environment variable does not have C:\Documents and Settings\All Users\Appl
ication Data\chocolatey\bin in it. Adding...
警告: Failure attempting to let Explorer know about updated environment
settings.
用語 'C:\WINDOWS\System32\setx.exe' は、コマンドレット、関数、スクリプト
ファイル、または操作可能なプログラムの名前として認識されません。名前が正しく記
述されていることを確認し、パスが含まれている場合はそのパスが正しいことを確認し
てから、再試行してください。
Attempting to upgrade 'C:\Chocolatey' to 'C:\Documents and Settings\All Users\A
pplication Data\chocolatey'.
WARNING: Copying the contents of 'C:\Chocolatey' to 'C:\Documents and Settings\A
ll Users\Application Data\chocolatey'.
This step may fail if you have anything in this folder running or locked.
If it fails, just manually copy the rest of the items out and then delete the f
older.
WARNING: !!!! ATTN: YOU WILL NEED TO CLOSE AND REOPEN YOUR SHELL !!!!
Updating 'User' PATH to reflect removal of 'C:\Chocolatey'.
警告: Failure attempting to let Explorer know about updated environment
settings.
用語 'C:\WINDOWS\System32\setx.exe' は、コマンドレット、関数、スクリプト
ファイル、または操作可能なプログラムの名前として認識されません。名前が正しく記
述されていることを確認し、パスが含まれている場合はそのパスが正しいことを確認し
てから、再試行してください。
警告: Not setting tab completion: Profile file does not exist at 'C:\Documents
and Settings\Administrator\My
Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
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.
WARNING: This action will result in Log Errors, you can safely ignore those.
You may need to finish removing 'C:\Chocolatey' manually.
Attempting to remove 'C:\Chocolatey'. This may fail if something in the folder
is being used or locked.
Ensuring chocolatey commands are on the path
Ensuring chocolatey.nupkg is in the lib folder
C:\Documents and Settings\All Users\Application Data\chocolatey
配下にインストールされていた。
実行確認
コンソールでchocoコマンドを実行したら以下の結果になった。
>choco
Chocolatey v0.10.0
バージョン確認
上記と同じ結果。
>choco --version
0.10.0
ヘルプ
>choco --help
This is a listing of all of the different things you can pass to choco.
Commands
* list - lists remote or local packages
* search - searches remote or local packages (alias for list)
* info - retrieves package information. Shorthand for choco search pkgname --ex
act --verbose
* install - installs packages from various sources
* pin - suppress upgrades for a package
* outdated - retrieves packages that are outdated. Similar to upgrade all --noo
p
* upgrade - upgrades packages from various sources
* uninstall - uninstalls a package
* pack - packages up a nuspec to a compiled nupkg
* push - pushes a compiled nupkg
* new - generates files necessary for a chocolatey package from a template
* source - view and configure default sources
* sources - view and configure default sources (alias for source)
* config - Retrieve and configure config file settings
* feature - view and configure choco features
* features - view and configure choco features (alias for feature)
* setapikey - retrieves or saves an apikey for a particular source (alias for a
pikey)
* apikey - retrieves or saves an apikey for a particular source
* unpackself - have chocolatey set it self up
* version - [DEPRECATED] will be removed in v1 - use `choco outdated` or `cup <
pkg|all> -whatif` instead
* update - [DEPRECATED] RESERVED for future use (you are looking for upgrade, t
hese are not the droids you are looking for)
Please run chocolatey with `choco command -help` for specific help on
each command.
How To Pass Options / Switches
You can pass options and switches in the following ways:
* Unless stated otherwise, an option/switch should only be passed one
time. Otherwise you may find weird/non-supported behavior.
* `-`, `/`, or `--` (one character switches should not use `--`)
* **Option Bundling / Bundled Options**: One character switches can be
bundled. e.g. `-d` (debug), `-f` (force), `-v` (verbose), and `-y`
(confirm yes) can be bundled as `-dfvy`.
* NOTE: If `debug` or `verbose` are bundled with local options
(not the global ones above), some logging may not show up until after
the local options are parsed.
* **Use Equals**: You can also include or not include an equals sign
`=` between options and values.
* **Quote Values**: When you need to quote an entire argument, such as
when using spaces, please use a combination of double quotes and
apostrophes (`"'value'"`). In cmd.exe you can just use double quotes
(`"value"`) but in powershell.exe you should use backticks
(`` `"value`" ``) or apostrophes (`'value'`). Using the combination
allows for both shells to work without issue, except for when the next
section applies.
* **Pass quotes in arguments**: When you need to pass quoted values to
to something like a native installer, you are in for a world of fun. In
cmd.exe you must pass it like this: `-ia "/yo=""Spaces spaces"""`. In
PowerShell.exe, you must pass it like this: `-ia '/yo=""Spaces spaces""'`.
No other combination will work. In PowerShell.exe if you are on version
v3+, you can try `--%` before `-ia` to just pass the args through as is,
which means it should not require any special workarounds.
* Options and switches apply to all items passed, so if you are
installing multiple packages, and you use `--version=1.0.0`, choco
is going to look for and try to install version 1.0.0 of every
package passed. So please split out multiple package calls when
wanting to pass specific options.
Default Options and Switches
-?, --help, -h
Prints out the help menu.
-d, --debug
Debug - Show debug messaging.
-v, --verbose
Verbose - Show verbose messaging.
--acceptlicense, --accept-license
AcceptLicense - Accept license dialogs automatically. Reserved for
future use.
-y, --yes, --confirm
Confirm all prompts - Chooses affirmative answer instead of prompting.
Implies --accept-license
-f, --force
Force - force the behavior. Do not use force during normal operation -
it subverts some of the smart behavior for commands.
--noop, --whatif, --what-if
NoOp / WhatIf - Don't actually do anything.
-r, --limitoutput, --limit-output
LimitOutput - Limit the output to essential information
--timeout, --execution-timeout=VALUE
CommandExecutionTimeout (in seconds) - The time to allow a command to
finish before timing out. Overrides the default execution timeout in the
configuration of 2700 seconds.
-c, --cache, --cachelocation, --cache-location=VALUE
CacheLocation - Location for download cache, defaults to %TEMP% or value
in chocolatey.config file.
--allowunofficial, --allow-unofficial, --allowunofficialbuild, --allow-unof
ficial-build
AllowUnofficialBuild - When not using the official build you must set
this flag for choco to continue.
--failstderr, --failonstderr, --fail-on-stderr, --fail-on-standard-error, -
-fail-on-error-output
FailOnStandardError - Fail on standard error output (stderr), typically
received when running external commands during install providers. This
overrides the feature failOnStandardError.
--use-system-powershell
UseSystemPowerShell - Execute PowerShell using an external process
instead of the built-in PowerShell host. Should only be used when
internal host is failing. Available in 0.9.10+.
Chocolatey v0.10.0
choco list -help
ヘルプからlistコマンドを発見。
また、ヘルプに以下のようにあった。
Please run chocolatey with `choco command -help` for specific help on
each command.
choco list -help
でlistコマンドの詳細がみれるらしい。やってみた。
>choco list -help
Chocolatey v0.10.0
List/Search Command
Chocolatey will perform a search for a package local or remote. Some
may prefer to use `clist` as a shortcut for `choco list`.
NOTE: 100% compatible with older Chocolatey client (0.9.8.x and below)
with options and switches. In most cases you can still pass options
and switches with one dash (`-`). For more details, see
the command reference (`choco -?`).
Usage
choco search <filter> [<options/switches>]
choco list <filter> [<options/switches>]
clist <filter> [<options/switches>]
Examples
choco list --local-only
choco list -li
choco list -lai
choco list --page=0 --page-size=25
choco search git
choco search git -s "'https://somewhere/out/there'"
choco search bob -s "'https://somewhere/protected'" -u user -p pass
See It In Action
choco search: https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gif
s/choco_search.gif
Alternative Sources
Available in 0.9.10+.
WebPI
This specifies the source is Web PI (Web Platform Installer) and that
we are searching for a WebPI product, such as IISExpress. If you do
not have the Web PI command line installed, it will install that first
and then perform the search requested.
e.g. `choco list --source webpi`
Windows Features
This specifies that the source is a Windows Feature and we should
install via the Deployment Image Servicing and Management tool (DISM)
on the local machine.
e.g. `choco list --source windowsfeatures`
Options and Switches
-?, --help, -h
Prints out the help menu.
-d, --debug
Debug - Show debug messaging.
-v, --verbose
Verbose - Show verbose messaging.
--acceptlicense, --accept-license
AcceptLicense - Accept license dialogs automatically. Reserved for
future use.
-y, --yes, --confirm
Confirm all prompts - Chooses affirmative answer instead of prompting.
Implies --accept-license
-f, --force
Force - force the behavior. Do not use force during normal operation -
it subverts some of the smart behavior for commands.
--noop, --whatif, --what-if
NoOp / WhatIf - Don't actually do anything.
-r, --limitoutput, --limit-output
LimitOutput - Limit the output to essential information
--timeout, --execution-timeout=VALUE
CommandExecutionTimeout (in seconds) - The time to allow a command to
finish before timing out. Overrides the default execution timeout in the
configuration of 2700 seconds.
-c, --cache, --cachelocation, --cache-location=VALUE
CacheLocation - Location for download cache, defaults to %TEMP% or value
in chocolatey.config file.
--allowunofficial, --allow-unofficial, --allowunofficialbuild, --allow-unof
ficial-build
AllowUnofficialBuild - When not using the official build you must set
this flag for choco to continue.
--failstderr, --failonstderr, --fail-on-stderr, --fail-on-standard-error, -
-fail-on-error-output
FailOnStandardError - Fail on standard error output (stderr), typically
received when running external commands during install providers. This
overrides the feature failOnStandardError.
--use-system-powershell
UseSystemPowerShell - Execute PowerShell using an external process
instead of the built-in PowerShell host. Should only be used when
internal host is failing. Available in 0.9.10+.
-s, --source=VALUE
Source - Source location for install. Can include special 'webpi'.
Defaults to sources.
-l, --lo, --localonly, --local-only
LocalOnly - Only search against local machine items.
--pre, --prerelease
Prerelease - Include Prereleases? Defaults to false.
-i, --includeprograms, --include-programs
IncludePrograms - Used in conjunction with LocalOnly, filters out apps
chocolatey has listed as packages and includes those in the list.
Defaults to false.
-a, --all, --allversions, --all-versions
AllVersions - include results from all versions.
-u, --user=VALUE
User - used with authenticated feeds. Defaults to empty.
-p, --password=VALUE
Password - the user's password to the source. Defaults to empty.
--cert=VALUE
Client certificate - PFX pathname for an x509 authenticated feeds.
Defaults to empty. Available in 0.9.10+.
--cp, --certpassword=VALUE
Certificate Password - the client certificate's password to the source.
Defaults to empty. Available in 0.9.10+.
--page=VALUE
Page - the 'page' of results to return. Defaults to return all results.
Available in 0.9.10+.
--page-size=VALUE
Page Size - the amount of package results to return per page. Defaults
to 25. Available in 0.9.10+.
-e, --exact
Exact - Only return packages with this exact name. Available in 0.9.10+.
--by-id-only
ByIdOnly - Only return packages where the id contains the search filter.
Available in 0.9.10+.
--id-starts-with
IdStartsWith - Only return packages where the id starts with the search
filter. Available in 0.9.10+.
--order-by-popularity
OrderByPopularity - Sort by package results by popularity. Available in
0.9.10+.
--approved-only
ApprovedOnly - Only return approved packages - this option will filter
out results not from the community repository. Available in 0.9.10+.
--download-cache, --download-cache-only
DownloadCacheAvailable - Only return packages that have a download cache
available - this option will filter out results not from the community
repository. Available in 0.9.10+.
--not-broken
NotBroken - Only return packages that are not failing testing - this
option only filters out failing results from the community feed. It will
not filter against other sources. Available in 0.9.10+.
--detail, --detailed
Detailed - Alias for verbose. Available in 0.9.10+.
choco list --local-only
ヘルプにchoco list --local-only
とあった。
さっそく実行。
>choco list --local-only
Chocolatey v0.10.0
chocolatey 0.10.0
ChocolateyGUI 0.11.1
imagemagick.app 6.9.0.0
NuGet.CommandLine 2.5.0
Pester 2.0.2
PowerShell 3.0.20121027
vcredist2010 10.0.40219.1
7 packages installed.
たぶん、今インストールされているものの一覧と思われる。
次回は、これでg++を入手できるか試してみる。