Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Installer]Create DSC module in right path for user installs #33782

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions installer/PowerToysSetupCustomActions/CustomAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ UINT __stdcall InstallDSCModuleCA(MSIHANDLE hInstall)
ExitOnFailure(hr, "Unable to determine Powershell modules path");
}

const auto modulesPath = baseModulesPath / L"Microsoft.PowerToys.Configure" / get_product_version();
const auto modulesPath = baseModulesPath / L"Microsoft.PowerToys.Configure" / get_product_version(false);

std::error_code errorCode;
fs::create_directories(modulesPath, errorCode);
Expand Down Expand Up @@ -411,7 +411,7 @@ UINT __stdcall UninstallDSCModuleCA(MSIHANDLE hInstall)
}

const auto powerToysModulePath = baseModulesPath / L"Microsoft.PowerToys.Configure";
const auto versionedModulePath = powerToysModulePath / get_product_version();
const auto versionedModulePath = powerToysModulePath / get_product_version(false);

std::error_code errorCode;

Expand Down
8 changes: 4 additions & 4 deletions src/common/version/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ enum class version_architecture
version_architecture get_current_architecture();
const wchar_t* get_architecture_string(const version_architecture);

inline std::wstring get_product_version()
inline std::wstring get_product_version(bool includeV = true)
{
static std::wstring version = L"v" + std::to_wstring(VERSION_MAJOR) +
static std::wstring version = (includeV ? L"v" : L"") + std::to_wstring(VERSION_MAJOR) +
L"." + std::to_wstring(VERSION_MINOR) +
L"." + std::to_wstring(VERSION_REVISION);

return version;
}

inline std::wstring get_std_product_version()
inline std::wstring get_std_product_version(bool includeV = true)
{
static std::wstring version = L"v" + std::to_wstring(VERSION_MAJOR) +
static std::wstring version = (includeV ? L"v" : L"") + std::to_wstring(VERSION_MAJOR) +
L"." + std::to_wstring(VERSION_MINOR) +
L"." + std::to_wstring(VERSION_REVISION) + L".0";

Expand Down
Loading