diff options
author | Bevan Weiss <bevan.weiss@gmail.com> | 2025-01-25 19:56:36 +1100 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2025-02-11 14:00:15 -0800 |
commit | 254196975c1f82bf7079a9d56b5417f5da9d8d76 (patch) | |
tree | 93620336756ef72c439a917180ac5958cc2abfb0 | |
parent | 3456eaa40c910eb3a6cb9197562517b9f119aa9a (diff) | |
download | wix-254196975c1f82bf7079a9d56b5417f5da9d8d76.tar.gz wix-254196975c1f82bf7079a9d56b5417f5da9d8d76.tar.bz2 wix-254196975c1f82bf7079a9d56b5417f5da9d8d76.zip |
IIS Ext: Add support for more certificate stores
Fixes wixtoolset/issues#1520
Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
-rw-r--r-- | src/ext/Iis/ca/scacert.cpp | 15 | ||||
-rw-r--r-- | src/ext/Iis/ca/scacert.h | 5 | ||||
-rw-r--r-- | src/ext/Iis/wixext/IIsCompiler.cs | 15 | ||||
-rw-r--r-- | src/ext/Iis/wixext/IisTableDefinitions.cs | 2 |
4 files changed, 36 insertions, 1 deletions
diff --git a/src/ext/Iis/ca/scacert.cpp b/src/ext/Iis/ca/scacert.cpp index ce7968e6..953c813e 100644 --- a/src/ext/Iis/ca/scacert.cpp +++ b/src/ext/Iis/ca/scacert.cpp | |||
@@ -213,6 +213,21 @@ static HRESULT ConfigureCertificates( | |||
213 | case SCA_CERTSYSTEMSTORE_LOCALMACHINE: | 213 | case SCA_CERTSYSTEMSTORE_LOCALMACHINE: |
214 | dwStoreLocation = CERT_SYSTEM_STORE_LOCAL_MACHINE; | 214 | dwStoreLocation = CERT_SYSTEM_STORE_LOCAL_MACHINE; |
215 | break; | 215 | break; |
216 | case SCA_CERTSYSTEMSTORE_SERVICES: | ||
217 | dwStoreLocation = CERT_SYSTEM_STORE_SERVICES; | ||
218 | break; | ||
219 | case SCA_CERTSYSTEMSTORE_USERS: | ||
220 | dwStoreLocation = CERT_SYSTEM_STORE_USERS; | ||
221 | break; | ||
222 | case SCA_CERTSYSTEMSTORE_USER_POLICY: | ||
223 | dwStoreLocation = CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY; | ||
224 | break; | ||
225 | case SCA_CERTSYSTEMSTORE_LOCALMACHINE_POLICY: | ||
226 | dwStoreLocation = CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY; | ||
227 | break; | ||
228 | case SCA_CERTSYSTEMSTORE_LOCALMACHINE_ENTERPRISE: | ||
229 | dwStoreLocation = CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE; | ||
230 | break; | ||
216 | default: | 231 | default: |
217 | hr = E_INVALIDARG; | 232 | hr = E_INVALIDARG; |
218 | ExitOnFailure(hr, "Invalid store location value: %d", iData); | 233 | ExitOnFailure(hr, "Invalid store location value: %d", iData); |
diff --git a/src/ext/Iis/ca/scacert.h b/src/ext/Iis/ca/scacert.h index 39b00d3d..6ce5ac72 100644 --- a/src/ext/Iis/ca/scacert.h +++ b/src/ext/Iis/ca/scacert.h | |||
@@ -20,4 +20,9 @@ enum SCA_CERTSYSTEMSTORE | |||
20 | { | 20 | { |
21 | SCA_CERTSYSTEMSTORE_CURRENTUSER = 1, | 21 | SCA_CERTSYSTEMSTORE_CURRENTUSER = 1, |
22 | SCA_CERTSYSTEMSTORE_LOCALMACHINE = 2, | 22 | SCA_CERTSYSTEMSTORE_LOCALMACHINE = 2, |
23 | SCA_CERTSYSTEMSTORE_SERVICES = 3, | ||
24 | SCA_CERTSYSTEMSTORE_USERS = 4, | ||
25 | SCA_CERTSYSTEMSTORE_USER_POLICY = 5, | ||
26 | SCA_CERTSYSTEMSTORE_LOCALMACHINE_POLICY = 6, | ||
27 | SCA_CERTSYSTEMSTORE_LOCALMACHINE_ENTERPRISE = 7, | ||
23 | }; | 28 | }; |
diff --git a/src/ext/Iis/wixext/IIsCompiler.cs b/src/ext/Iis/wixext/IIsCompiler.cs index 1fcf5f61..5e3c0a95 100644 --- a/src/ext/Iis/wixext/IIsCompiler.cs +++ b/src/ext/Iis/wixext/IIsCompiler.cs | |||
@@ -202,6 +202,21 @@ namespace WixToolset.Iis | |||
202 | case "localMachine": | 202 | case "localMachine": |
203 | storeLocation = 2; // SCA_CERTSYSTEMSTORE_LOCALMACHINE | 203 | storeLocation = 2; // SCA_CERTSYSTEMSTORE_LOCALMACHINE |
204 | break; | 204 | break; |
205 | case "services": | ||
206 | storeLocation = 3; // SCA_CERTSYSTEMSTORE_SERVICES | ||
207 | break; | ||
208 | case "users": | ||
209 | storeLocation = 4; // SCA_CERTSYSTEMSTORE_USERS | ||
210 | break; | ||
211 | case "userPolicy": | ||
212 | storeLocation = 5; // SCA_CERTSYSTEMSTORE_USER_POLICY | ||
213 | break; | ||
214 | case "localMachinePolicy": | ||
215 | storeLocation = 6; // SCA_CERTSYSTEMSTORE_LOCALMACHINE_POLICY | ||
216 | break; | ||
217 | case "localMachineEnterprise": | ||
218 | storeLocation = 7; // SCA_CERTSYSTEMSTORE_LOCALMACHINE_ENTERPRISE | ||
219 | break; | ||
205 | default: | 220 | default: |
206 | storeLocation = -1; | 221 | storeLocation = -1; |
207 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "StoreLocation", storeLocationValue, "currentUser", "localMachine")); | 222 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "StoreLocation", storeLocationValue, "currentUser", "localMachine")); |
diff --git a/src/ext/Iis/wixext/IisTableDefinitions.cs b/src/ext/Iis/wixext/IisTableDefinitions.cs index df3edf1d..1adb781a 100644 --- a/src/ext/Iis/wixext/IisTableDefinitions.cs +++ b/src/ext/Iis/wixext/IisTableDefinitions.cs | |||
@@ -14,7 +14,7 @@ namespace WixToolset.Iis | |||
14 | new ColumnDefinition("Certificate", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyColumn: 1, description: "Identifier for the certificate in the package.", modularizeType: ColumnModularizeType.Column), | 14 | new ColumnDefinition("Certificate", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyColumn: 1, description: "Identifier for the certificate in the package.", modularizeType: ColumnModularizeType.Column), |
15 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, description: "Foreign key into the Component table used to determine install state", modularizeType: ColumnModularizeType.Column), | 15 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, description: "Foreign key into the Component table used to determine install state", modularizeType: ColumnModularizeType.Column), |
16 | new ColumnDefinition("Name", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name to be used for the Certificate."), | 16 | new ColumnDefinition("Name", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name to be used for the Certificate."), |
17 | new ColumnDefinition("StoreLocation", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 2, description: "Location of the target certificate store (CurrentUser == 1, LocalMachine == 2)"), | 17 | new ColumnDefinition("StoreLocation", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 7, description: "Location of the target certificate store (CurrentUser == 1, LocalMachine == 2, Services == 3, Users == 4, User Group Policy == 5, LocalMachine Group Policy == 6, LocalMachine Enterprise == 7)"), |
18 | new ColumnDefinition("StoreName", ColumnType.String, 64, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name of the target certificate store"), | 18 | new ColumnDefinition("StoreName", ColumnType.String, 64, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name of the target certificate store"), |
19 | new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "Attributes of the certificate"), | 19 | new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "Attributes of the certificate"), |
20 | new ColumnDefinition("Binary_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "Binary", keyColumn: 1, description: "Identifier to Binary table containing certificate.", modularizeType: ColumnModularizeType.Column), | 20 | new ColumnDefinition("Binary_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "Binary", keyColumn: 1, description: "Identifier to Binary table containing certificate.", modularizeType: ColumnModularizeType.Column), |