diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-10-04 14:14:58 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-10-04 14:14:58 -0700 |
| commit | a34b6ee16e424e815193010ee0708033cf693d9d (patch) | |
| tree | 9d15de138ff402d2d3c48d4ae98e159c9615ab57 /toolsrc/src/VcpkgPaths.cpp | |
| parent | 40d531e911618c6e2517d9646c39ad538fd0d352 (diff) | |
| parent | d25fd5c7b3b0f21581dd9c44a915c9156683877a (diff) | |
| download | vcpkg-a34b6ee16e424e815193010ee0708033cf693d9d.tar.gz vcpkg-a34b6ee16e424e815193010ee0708033cf693d9d.zip | |
Merge branch 'export-ifw' of https://github.com/podsvirov/vcpkg into podsvirov-export-ifw
Diffstat (limited to 'toolsrc/src/VcpkgPaths.cpp')
| -rw-r--r-- | toolsrc/src/VcpkgPaths.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/toolsrc/src/VcpkgPaths.cpp b/toolsrc/src/VcpkgPaths.cpp index cb00183fd..19210facf 100644 --- a/toolsrc/src/VcpkgPaths.cpp +++ b/toolsrc/src/VcpkgPaths.cpp @@ -173,6 +173,31 @@ namespace vcpkg return fetch_dependency(scripts_folder, L"git", downloaded_copy, EXPECTED_VERSION); } + static fs::path get_ifw_installerbase_path(const fs::path& downloads_folder, const fs::path& scripts_folder) + { + static constexpr std::array<int, 3> EXPECTED_VERSION = { 3, 1, 81 }; + static const std::wstring VERSION_CHECK_ARGUMENTS = L"--framework-version"; + + const fs::path downloaded_copy = downloads_folder / "QtInstallerFramework-win-x86" / "bin" / "installerbase.exe"; + + std::vector<fs::path> candidate_paths; + candidate_paths.push_back(downloaded_copy); + // TODO: Uncomment later + //const std::vector<fs::path> from_path = Files::find_from_PATH(L"installerbase"); + //candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend()); + //candidate_paths.push_back(fs::path(System::get_environment_variable(L"HOMEDRIVE").value_or("C:")) / "Qt" / "Tools" / "QtInstallerFramework" / "3.1" / "bin" / "installerbase.exe"); + //candidate_paths.push_back(fs::path(System::get_environment_variable(L"HOMEDRIVE").value_or("C:")) / "Qt" / "QtIFW-3.1.0" / "bin" / "installerbase.exe"); + + const Optional<fs::path> path = + find_if_has_equal_or_greater_version(candidate_paths, VERSION_CHECK_ARGUMENTS, EXPECTED_VERSION); + if (const auto p = path.get()) + { + return *p; + } + + return fetch_dependency(scripts_folder, L"installerbase", downloaded_copy, EXPECTED_VERSION); + } + Expected<VcpkgPaths> VcpkgPaths::create(const fs::path& vcpkg_root_dir) { std::error_code ec; @@ -256,6 +281,21 @@ namespace vcpkg return this->nuget_exe.get_lazy([this]() { return get_nuget_path(this->downloads, this->scripts); }); } + const fs::path& VcpkgPaths::get_ifw_installerbase_exe() const + { + return this->ifw_installerbase_exe.get_lazy([this]() { return get_ifw_installerbase_path(this->downloads, this->scripts); }); + } + + const fs::path& VcpkgPaths::get_ifw_binarycreator_exe() const + { + return this->ifw_binarycreator_exe.get_lazy([this]() { return get_ifw_installerbase_exe().parent_path() / "binarycreator.exe"; }); + } + + const fs::path& VcpkgPaths::get_ifw_repogen_exe() const + { + return this->ifw_repogen_exe.get_lazy([this]() { return get_ifw_installerbase_exe().parent_path() / "repogen.exe"; }); + } + static std::vector<std::string> get_vs2017_installation_instances(const VcpkgPaths& paths) { const fs::path script = paths.scripts / "findVisualStudioInstallationInstances.ps1"; |
