@@ -84,6 +84,7 @@ void NavigationPaneHelper::updateCloudStorageRegistry()
84
84
85
85
QString clsidStr = folder->navigationPaneClsid ().toString ();
86
86
QString clsidPath = QString () % " Software\\ Classes\\ CLSID\\ " % clsidStr;
87
+ QString clsidPathWow64 = QString () % " Software\\ Classes\\ Wow6432Node\\ CLSID\\ " % clsidStr;
87
88
QString namespacePath = QString () % " Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ Desktop\\ NameSpace\\ " % clsidStr;
88
89
89
90
QString title = folder->shortGuiRemotePathOrAppName ();
@@ -98,25 +99,35 @@ void NavigationPaneHelper::updateCloudStorageRegistry()
98
99
// Steps taken from: https://msdn.microsoft.com/en-us/library/windows/desktop/dn889934%28v=vs.85%29.aspx
99
100
// Step 1: Add your CLSID and name your extension
100
101
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath, QString (), REG_SZ, title);
102
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64, QString (), REG_SZ, title);
101
103
// Step 2: Set the image for your icon
102
104
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath + QStringLiteral (" \\ DefaultIcon" ), QString (), REG_SZ, iconPath);
105
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64 + QStringLiteral (" \\ DefaultIcon" ), QString (), REG_SZ, iconPath);
103
106
// Step 3: Add your extension to the Navigation Pane and make it visible
104
107
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath, QStringLiteral (" System.IsPinnedToNameSpaceTree" ), REG_DWORD, 0x1 );
108
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64, QStringLiteral (" System.IsPinnedToNameSpaceTree" ), REG_DWORD, 0x1 );
105
109
// Step 4: Set the location for your extension in the Navigation Pane
106
110
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath, QStringLiteral (" SortOrderIndex" ), REG_DWORD, 0x41 );
111
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64, QStringLiteral (" SortOrderIndex" ), REG_DWORD, 0x41 );
107
112
// Step 5: Provide the dll that hosts your extension.
108
113
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath + QStringLiteral (" \\ InProcServer32" ), QString (), REG_EXPAND_SZ, QStringLiteral (" %systemroot%\\ system32\\ shell32.dll" ));
114
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64 + QStringLiteral (" \\ InProcServer32" ), QString (), REG_EXPAND_SZ, QStringLiteral (" %systemroot%\\ system32\\ shell32.dll" ));
109
115
// Step 6: Define the instance object
110
116
// Indicate that your namespace extension should function like other file folder structures in File Explorer.
111
117
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath + QStringLiteral (" \\ Instance" ), QStringLiteral (" CLSID" ), REG_SZ, QStringLiteral (" {0E5AAE11-A475-4c5b-AB00-C66DE400274E}" ));
118
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64 + QStringLiteral (" \\ Instance" ), QStringLiteral (" CLSID" ), REG_SZ, QStringLiteral (" {0E5AAE11-A475-4c5b-AB00-C66DE400274E}" ));
112
119
// Step 7: Provide the file system attributes of the target folder
113
120
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath + QStringLiteral (" \\ Instance\\ InitPropertyBag" ), QStringLiteral (" Attributes" ), REG_DWORD, 0x11 );
121
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64 + QStringLiteral (" \\ Instance\\ InitPropertyBag" ), QStringLiteral (" Attributes" ), REG_DWORD, 0x11 );
114
122
// Step 8: Set the path for the sync root
115
123
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath + QStringLiteral (" \\ Instance\\ InitPropertyBag" ), QStringLiteral (" TargetFolderPath" ), REG_SZ, targetFolderPath);
124
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64 + QStringLiteral (" \\ Instance\\ InitPropertyBag" ), QStringLiteral (" TargetFolderPath" ), REG_SZ, targetFolderPath);
116
125
// Step 9: Set appropriate shell flags
117
126
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath + QStringLiteral (" \\ ShellFolder" ), QStringLiteral (" FolderValueFlags" ), REG_DWORD, 0x28 );
127
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64 + QStringLiteral (" \\ ShellFolder" ), QStringLiteral (" FolderValueFlags" ), REG_DWORD, 0x28 );
118
128
// Step 10: Set the appropriate flags to control your shell behavior
119
129
Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPath + QStringLiteral (" \\ ShellFolder" ), QStringLiteral (" Attributes" ), REG_DWORD, 0xF080004D );
130
+ Utility::registrySetKeyValue (HKEY_CURRENT_USER, clsidPathWow64 + QStringLiteral (" \\ ShellFolder" ), QStringLiteral (" Attributes" ), REG_DWORD, 0xF080004D );
120
131
// Step 11: Register your extension in the namespace root
121
132
Utility::registrySetKeyValue (HKEY_CURRENT_USER, namespacePath, QString (), REG_SZ, title);
122
133
// Step 12: Hide your extension from the Desktop
@@ -137,11 +148,13 @@ void NavigationPaneHelper::updateCloudStorageRegistry()
137
148
foreach (auto &clsid, entriesToRemove) {
138
149
QString clsidStr = clsid.toString ();
139
150
QString clsidPath = QString () % " Software\\ Classes\\ CLSID\\ " % clsidStr;
151
+ QString clsidPathWow64 = QString () % " Software\\ Classes\\ Wow6432Node\\ CLSID\\ " % clsidStr;
140
152
QString namespacePath = QString () % " Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ Desktop\\ NameSpace\\ " % clsidStr;
141
153
142
154
qCInfo (lcNavPane) << " Explorer Cloud storage provider: now unused, removing own CLSID" << clsidStr;
143
155
#ifdef Q_OS_WIN
144
156
Utility::registryDeleteKeyTree (HKEY_CURRENT_USER, clsidPath);
157
+ Utility::registryDeleteKeyTree (HKEY_CURRENT_USER, clsidPathWow64);
145
158
Utility::registryDeleteKeyTree (HKEY_CURRENT_USER, namespacePath);
146
159
Utility::registryDeleteKeyValue (HKEY_CURRENT_USER, QStringLiteral (" Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Explorer\\ HideDesktopIcons\\ NewStartPanel" ), clsidStr);
147
160
#endif
0 commit comments