Bugs item #1787888, was opened at 2007-09-04 11:55
Message generated for change (Settings changed) made by jhancock93
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1787888&group_id=105970
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: extensions
Group: v3.0
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: John Hancock (jhancock93)
Assigned to: Rob Mensching (robmen)
Summary: Certificate in conditional component causes failure
Initial Comment:
In Wix v3, I’ve got a conditional component that is supposed to install a
certificate when the property CERTIFICATEPATH is set, but the
InstallCertificates action seems to be called regardless of whether the
component with the certificate is installed. InstallCertificates then fails
installing with the invalid data.
The component definition:
<Component Id="CertificateComponent" Guid="MY-GUID" KeyPath="yes">
<Condition>Installed OR CERTIFICATEPATH</Condition>
<iis:Certificate Id="SSLcertificate" Name="MySSLCertificate"
CertificatePath="[CERTIFICATEPATH]" Request="no"
PFXPassword="[CERTIFICATEPASSWORD]" StoreLocation="localMachine"
StoreName="personal"/>
</Component>
Early in the log, the install states for the CertificateComponent are:
MSI (s) (88:74) [09:19:35:063]: Component: CertificateComponent; Installed:
Absent; Request: Local; Action: Null
The log then shows InstallCertificates being installed and trying to resolve
the SSLCertificate:
MSI (s) (88:74) [09:19:35:854]: Doing action: InstallCertificates
Action 9:19:35: InstallCertificates.
Action start 9:19:35: InstallCertificates.
MSI (s) (88:74) [09:19:35:864]: Creating MSIHANDLE (30) of type 790542 for
thread 3188
MSI (s) (88:74) [09:19:35:864]: Invoking remote custom action. DLL:
C:\WINNT\Installer\MSI72.tmp, Entrypoint: InstallCertificates
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (31) of type 790541 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (32) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (32) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (33) of type 790540 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (34) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (35) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (35) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (36) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (36) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (37) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (37) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (38) of type 790531 for
thread 3060
InstallCertificates: Error 0x80070003: Failed to read PFX file:
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (38) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (39) of type 790531 for
thread 3060
InstallCertificates: Error 0x80070003: Failed to read certificate from file
path.
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (39) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Creating MSIHANDLE (40) of type 790531 for
thread 3060
InstallCertificates: Error 0x80070003: Failed to resolve certificate:
SSLcertificate
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (40) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (34) of type 790531 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (33) of type 790540 for
thread 3060
MSI (s) (88!F4) [09:19:36:085]: Closing MSIHANDLE (31) of type 790541 for
thread 3060
MSI (s) (88:74) [09:19:36:085]: Closing MSIHANDLE (30) of type 790542 for
thread 3188
Action ended 9:19:36: InstallCertificates. Return value 3.
----------------------------------------------------------------------
Comment By: John Hancock (jhancock93)
Date: 2007-09-20 10:49
Message:
Logged In: YES
user_id=1226005
Originator: YES
File Added: CertificateFix.dpk
----------------------------------------------------------------------
Comment By: John Hancock (jhancock93)
Date: 2007-09-14 15:04
Message:
Logged In: YES
user_id=1226005
Originator: YES
Sorry, one last comment. Looks like the correct code should be:
if (!(WcaIsInstalling(isInstalled, isAction) && saAction ==
SCA_ACTION_INSTALL)
&& !(WcaIsUninstalling(isInstalled, isAction) && saAction ==
SCA_ACTION_UNINSTALL))
{
WcaLog(LOGMSG_VERBOSE, "Skipping non-action certificate: %S", pwzId);
continue;
}
I'd make the change myself, but I don't have source change access...
----------------------------------------------------------------------
Comment By: John Hancock (jhancock93)
Date: 2007-09-14 14:25
Message:
Logged In: YES
user_id=1226005
Originator: YES
I've been tracing the code a bit more and it looks like the problem comes
down to the following lines in ConfigureCertificates (called from the
InstallCertificates custom action):
er = ::MsiGetComponentStateW(WcaGetInstallHandle(), pwzComponent,
&isInstalled, &isAction);
hr = HRESULT_FROM_WIN32(er);
ExitOnFailure1(hr, "failed to get state for component: %S",
pwzComponent);
if ((WcaIsInstalling(isInstalled, isAction) && SCA_ACTION_INSTALL !=
saAction) ||
(WcaIsUninstalling(isInstalled, isAction) && SCA_ACTION_UNINSTALL !=
saAction))
{
WcaLog(LOGMSG_VERBOSE, "Skipping non-action certificate: %S",
pwzId);
continue;
}
In my case, since the component is conditional, MsiGetComponentState
returns INSTALLSTATE_ABSENT for isInstalled and INSTALLSTATE_UNKNOWN for
isAction. So, WcaIsInstalling and WcaIsUninstalling are both false, but
that does not result in the certificate being skipped. Instead, the code
tries to read the certificate file and fails.
It seems to me that regardless of the saAction state passed in to the
function that if both WcaIsInstalling and WcaIsUninstalling return false,
that the certificate should be skipped as non-actionable.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1787888&group_id=105970
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs