Skip to content

Commit ba73bc7

Browse files
[Installer]Don't enable pdf preview by default (#17274)
* [Installer]Don't enable pdf preview by default * Change settings UI when there's no settings as well * clear analyzer errors
1 parent bdbf0b8 commit ba73bc7

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

installer/PowerToysSetupCustomActions/CustomAction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ UINT __stdcall ApplyModulesRegistryChangeSetsCA(MSIHANDLE hInstall)
7575
hr = getInstallFolder(hInstall, installationFolder);
7676
ExitOnFailure(hr, "Failed to get installFolder.");
7777

78-
for (const auto& changeSet : getAllModulesChangeSets(installationFolder))
78+
for (const auto& changeSet : getAllOnByDefaultModulesChangeSets(installationFolder))
7979
{
8080
if (!changeSet.apply())
8181
{

src/common/utils/modulesRegistry.h

+12
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,18 @@ inline registry::ChangeSet getStlThumbnailHandlerChangeSet(const std::wstring in
201201
NonLocalizable::ExtSTL);
202202
}
203203

204+
inline std::vector<registry::ChangeSet> getAllOnByDefaultModulesChangeSets(const std::wstring installationDir)
205+
{
206+
constexpr bool PER_USER = true;
207+
return { getSvgPreviewHandlerChangeSet(installationDir, PER_USER),
208+
getMdPreviewHandlerChangeSet(installationDir, PER_USER),
209+
getMonacoPreviewHandlerChangeSet(installationDir, PER_USER),
210+
getGcodePreviewHandlerChangeSet(installationDir, PER_USER),
211+
getSvgThumbnailHandlerChangeSet(installationDir, PER_USER),
212+
getGcodeThumbnailHandlerChangeSet(installationDir, PER_USER),
213+
getStlThumbnailHandlerChangeSet(installationDir, PER_USER) };
214+
}
215+
204216
inline std::vector<registry::ChangeSet> getAllModulesChangeSets(const std::wstring installationDir)
205217
{
206218
constexpr bool PER_USER = true;

src/settings-ui/Settings.UI.Library/PowerPreviewProperties.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public bool EnableMonacoPreviewWordWrap
9797
}
9898
}
9999

100-
private bool enablePdfPreview = true;
100+
private bool enablePdfPreview;
101101

102102
[JsonPropertyName("pdf-previewer-toggle-setting")]
103103
[JsonConverter(typeof(BoolPropertyJsonConverter))]
@@ -114,7 +114,7 @@ public bool EnablePdfPreview
114114
}
115115
}
116116

117-
private bool enablePdfThumbnail = true;
117+
private bool enablePdfThumbnail;
118118

119119
[JsonPropertyName("pdf-thumbnail-toggle-setting")]
120120
[JsonConverter(typeof(BoolPropertyJsonConverter))]

0 commit comments

Comments
 (0)