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

Add configuration modules path to '--info' #5023

Merged
merged 2 commits into from
Dec 10, 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
1 change: 1 addition & 0 deletions src/AppInstallerCLICore/Commands/RootCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ namespace AppInstaller::CLI
keyDirectories.OutputLine({ Resource::LocString{ Resource::String::PortableRoot }, Runtime::GetPathTo(Runtime::PathName::PortablePackageMachineRoot, true).u8string() });
keyDirectories.OutputLine({ Resource::LocString{ Resource::String::PortableRoot86 }, Runtime::GetPathTo(Runtime::PathName::PortablePackageMachineRootX86, true).u8string() });
keyDirectories.OutputLine({ Resource::LocString{ Resource::String::InstallerDownloads }, Runtime::GetPathTo(Runtime::PathName::UserProfileDownloads, true).u8string() });
keyDirectories.OutputLine({ Resource::LocString{ Resource::String::ConfigurationModules }, Runtime::GetPathTo(Runtime::PathName::ConfigurationModules, true).u8string() });
keyDirectories.Complete();
context.Reporter.Info() << std::endl;
}
Expand Down
1 change: 1 addition & 0 deletions src/AppInstallerCLICore/Resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ namespace AppInstaller::CLI::Resource
WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationModuleNameOnly);
WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationModulePath);
WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationModulePathArgError);
WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationModules);
WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationModuleWithDetails);
WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationNotEnabledMessage);
WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationNoTestRun);
Expand Down
10 changes: 7 additions & 3 deletions src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ Please specify one of them using the --source option to proceed.</value>
<data name="ConfigurationSuccessfullyApplied" xml:space="preserve">
<value>Configuration successfully applied.</value>
</data>
<data name="ConfigurationUnitSuccessfullyApplied" xml:space="preserve">
<data name="ConfigurationUnitSuccessfullyApplied" xml:space="preserve">
<value>Unit successfully applied.</value>
</data>
<data name="ConfigurationWaitingOnAnother" xml:space="preserve">
Expand Down Expand Up @@ -3147,7 +3147,7 @@ Please specify one of them using the --source option to proceed.</value>
</data>
<data name="InstallerZeroByteFile" xml:space="preserve">
<value>Downloaded zero byte installer; ensure that your network connection is working properly.</value>
</data>
</data>
<data name="FontCommandShortDescription" xml:space="preserve">
<value>Manage fonts</value>
</data>
Expand Down Expand Up @@ -3183,4 +3183,8 @@ Please specify one of them using the --source option to proceed.</value>
<data name="FontVersion" xml:space="preserve">
<value>Version</value>
</data>
</root>
<data name="ConfigurationModules" xml:space="preserve">
<value>Configuration Modules</value>
mdanish-kh marked this conversation as resolved.
Show resolved Hide resolved
<comment>PowerShell Modules that are used for the Configuration feature</comment>
</data>
</root>
2 changes: 2 additions & 0 deletions src/AppInstallerCommonCore/Public/AppInstallerRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ namespace AppInstaller::Runtime
SelfPackageRoot,
// The location where user downloads are stored.
UserProfileDownloads,
// The location where configuration modules are stored.
ConfigurationModules,
// The location where checkpoints are stored.
CheckpointsLocation,
// The location of the CLI executable file.
Expand Down
13 changes: 13 additions & 0 deletions src/AppInstallerCommonCore/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace AppInstaller::Runtime
constexpr std::string_view s_PortablePackagesDirectory = "Packages"sv;
constexpr std::string_view s_LinksDirectory = "Links"sv;
constexpr std::string_view s_FontsInstallDirectory = "Microsoft\\Windows\\Fonts"sv;
constexpr std::string_view s_ConfigurationModulesDirectory = "Configuration\\Modules"sv;
// Use production CLSIDs as a surrogate for repository location.
#if USE_PROD_CLSIDS
constexpr std::string_view s_ImageAssetsDirectoryRelative = "Assets\\WinGet"sv;
Expand Down Expand Up @@ -240,6 +241,16 @@ namespace AppInstaller::Runtime
case PathName::FontsMachineInstallLocation:
result.Path = GetKnownFolderPath(FOLDERID_Fonts);
break;
case PathName::ConfigurationModules:
result.Path = Settings::User().Get<Setting::ConfigureDefaultModuleRoot>();
if (result.Path.empty())
{
result.Path = GetKnownFolderPath(FOLDERID_LocalAppData);
result.Path /= s_SecureSettings_Base;
result.Path /= s_ConfigurationModulesDirectory;
}
mayBeInProfilePath = true;
break;
default:
THROW_HR(E_UNEXPECTED);
}
Expand Down Expand Up @@ -316,6 +327,7 @@ namespace AppInstaller::Runtime
case PathName::UserProfileDownloads:
case PathName::FontsUserInstallLocation:
case PathName::FontsMachineInstallLocation:
case PathName::ConfigurationModules:
result = GetPathDetailsCommon(path, forDisplay);
break;
case PathName::SelfPackageRoot:
Expand Down Expand Up @@ -422,6 +434,7 @@ namespace AppInstaller::Runtime
case PathName::UserProfileDownloads:
case PathName::FontsUserInstallLocation:
case PathName::FontsMachineInstallLocation:
case PathName::ConfigurationModules:
result = GetPathDetailsCommon(path, forDisplay);
break;
case PathName::SelfPackageRoot:
Expand Down
Loading