diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-10-04 16:25:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-04 16:25:17 -0700 |
| commit | 875a1269be98971d492f0761e0ed3502957b5673 (patch) | |
| tree | 5d6748c384cb46f0df59ced1f7f8dab4bd983bea /toolsrc/src/VcpkgPaths.cpp | |
| parent | 40d531e911618c6e2517d9646c39ad538fd0d352 (diff) | |
| parent | c98db7541594eadccf6823d4fdde2ff8c53c5fe9 (diff) | |
| download | vcpkg-875a1269be98971d492f0761e0ed3502957b5673.tar.gz vcpkg-875a1269be98971d492f0761e0ed3502957b5673.zip | |
Merge pull request #1734 from podsvirov/export-ifw
WIP: Export IFW (Beta)
Diffstat (limited to 'toolsrc/src/VcpkgPaths.cpp')
| -rw-r--r-- | toolsrc/src/VcpkgPaths.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/toolsrc/src/VcpkgPaths.cpp b/toolsrc/src/VcpkgPaths.cpp index cb00183fd..9f85992be 100644 --- a/toolsrc/src/VcpkgPaths.cpp +++ b/toolsrc/src/VcpkgPaths.cpp @@ -173,6 +173,34 @@ 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 +284,24 @@ 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"; |
