I am getting an error message when running the WiX installer in console mode. It works in normal mode. The error log says
CreateUser: Error 0x80070103: failed to read attributes from custom action data
CustomAction CreateUser returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
After reading up on it appears to be something with the security of the properties Name / Account. I've tried setting the [ACCOUNT] and [PASSWORD] property to Secure="yes" but it didnt work
The log files says and the same error message:
Property(S): AdminProperties = ACCOUNT;PASSWORD
Property(S): SecureCustomProperties = ACCOUNT;NETFRAMEWORK45;PASSWORD;WIX_DOWNGRADE_DETECTED;WIX_UPGRADE_DETECTED
The command line looks something like this
C:\build\console\setup.exe -passive /Account mydomain\myuser /Password mypassword /Verify
and wix code that fails
<util:User Id="GrantUserLogOnAsService" UpdateIfExists="no" FailIfExists="no" RemoveOnUninstall ="no" CreateUser="no" LogonAsService="yes"
Name="[ACCOUNT]"/>
I also tried to hardcode it and it does succeed...
<util:User Id="GrantUserLogOnAsService" UpdateIfExists="no" FailIfExists="no" RemoveOnUninstall ="no" CreateUser="no" LogonAsService="yes"
Name="mydomain/myuser" />
I would be happy if I could just catch the error and ignore it, however the util:user does not have a vital="no" attribute. Thanks for any help on this.
The mystery is why the properties cannot be read, when [Account] = mydomain/myuser. I've verified this by looking at the logs.
Can I resolve the [ACCOUNT] property to a normal string before i pass it to util:User? since it seems to fail at resolving it inside.
Related
In product.wxs I have:
<UIRef Id="WixUI_InstallDir" />
In LocalizableResources.wxl I have tried to override some strings:
<String Id="BrowseDlg_Title">I was here</String>
<String Id="InvalidDirDlg_Title">I was here</String>
<String Id="InvalidDirDlgText">I was here</String>
It works for the BrowseDlg, but not for the InvalidDirDlg. When I run the installer and I try to choose a DVD drive for the install directory, the error message I get is "The volume D:\ is currently unavailable. Please select another." This isn't even the expected string from WixUI_en-us.wxl, which is "Installation directory must be on a local hard drive."
How can I override the InvalidDirDlg? Why is it displaying the wrong error message?
Actually, the code in the question does work! If I choose a USB stick I get the InvalidDirDlg popping up with the overridden strings. It's only the DVD drive that doesn't work.
I was able to override the error for the DVD drive by using an Error element as explained here.
My first question is about the error below :
Module [Path/Name of dll].dll failed to register. HRESULT -2147024769. Contact your support personnel.
I can continue the installation but i want to get rid of this error if possible.
The second question is about the following error :
Error 1001. Exception occured when initializing the installation.
System.IO.FileNotFoundException: could not load file or assembly 'file:///C:\Windows\SysWOW64\files' or one of it's dependencies. The system cannot find the file specified.
I saw in different site and thread that the cause was the custom Action (in the value : /target=”[TARGETDIR]” -> /target=”[TARGETDIR]\”) but I can't found where is the error in my custom action. Here are the custom action realized using Designer for Wix Toolset :
<CustomAction Id="DIRCA_TARGETDIR" Property="TARGETDIR" Value="[ProgramFilesFolder][Manufacturer]\[ProductName]" Execute="firstSequence" />
<CustomAction Id="_FB3FF635_EF79_4863_91BD_70A0A11955B2.Uninstall" Execute="deferred" BinaryKey="InstallUtil" DllEntry="ManagedInstall" adx:VSName="Primary Output from Project" />
<CustomAction Id="_FB3FF635_EF79_4863_91BD_70A0A11955B2.Uninstall.SetProperty" Property="_FB3FF635_EF79_4863_91BD_70A0A11955B2.Uninstall" Value="/installtype=notransaction /action=uninstall /LogFile= /targ="[TARGETDIR]\" /usr=[ALLUSERS] /usr2=[MSIINSTALLPERUSER] /CommonProjAppData="[PROJCOMMONDATA]\" "[#_F521D169_ECD0_42B5_87F7_C2D8B6F9CA54]" "[VSDFxConfigFile]"" adx:VSName="Primary Output from Project" />
<CustomAction Id="_BE73DAD9_3524_4376_B45C_148B5871465B.Install" Execute="deferred" BinaryKey="InstallUtil" DllEntry="ManagedInstall" adx:VSName="Primary Output from Project" />
<CustomAction Id="_BE73DAD9_3524_4376_B45C_148B5871465B.Install.SetProperty" Property="_BE73DAD9_3524_4376_B45C_148B5871465B.Install" Value="/installtype=notransaction /action=install /LogFile= /targ="[TARGETDIR]\" /usr=[ALLUSERS] /usr2=[MSIINSTALLPERUSER] /CommonProjAppData="[PROJCOMMONDATA]\" "[#_F521D169_ECD0_42B5_87F7_C2D8B6F9CA54]" "[VSDFxConfigFile]"" adx:VSName="Primary Output from Project" />
<CustomAction Id="CA_CreateConfig" BinaryKey="ADXDPCADLL" DllEntry="GetConfig" />
Thanks for helping.
You're basically going in the wrong direction. You've converted a Visual Studio setup to WiX but you're trying to carry that VS custom action framework into WiX. The VS framework that calls managed code custom actions involves calling a C++ binary that then tries to load a NET runtime then use reflection to get into your assembly, instantiate classes and call methods. Apart from the fact that the InstallUtil Dll is transparent, undocumented and architecture dependent (you need either the 64-bit version or the 32-bit version) and therefore impossible to debug in cases like this, nobody actually bothers to propagate all this stuff into the WiX world because there are much better alternatives. For example if you're using installer classes to install services you don't need them at all. See ServiceInstall and ServiceControl. For generic custom action calls into managed code use the DTF managed code custom action framework.
I'm trying to add a check in my installer, so that if a specific registry key is not present it has to fail. That's roughly what I'm doing:
<Property Id="REGVALUE">
<RegistrySearch Id="regval" Root="HKLM" Key="SOFTWARE\Foo" Type="raw"/>
</Property>
<Condition Message="Valid Foo value not present. Found [REGVALUE]">
<![CDATA[REGVALUE = "Bar" OR REMOVE ~= "ALL"]]>
</Condition>
The problem I'm having is that this condition always fail. I tried querying different registry keys and no matter what I try, I always get a blank value. In the install log I can't see any access to the registry, nor any error related to the registry. So I'm a bit lost. Am I missing something obvious?
Found the problem. The issue was an incorrect ordering of actions in the installer ui sequence, which caused the conditions to be checked before running the registry queries.
So far, I'm NOT finding WIX to be my favorite most intuitive, easy-to-use, language/system.
I created a custom dialog, entered data, and see the values in the install log.
MSI (c) (C8:A4) [14:42:37:137]: PROPERTY CHANGE: Modifying VARRADIOBUTTONENVIRONMENT property. Its current value is 'Dev'. Its new value: 'QA'.
MSI (c) (C8:A4) [14:42:41:448]: PROPERTY CHANGE: Modifying VARTEXTSETTINGSFILENAME property. Its current value is 'C:\Path\SettingsFileGenerator.xml'. Its new value: 'Test1234.txt'.
Later, when it comes time to use the value I see this:
Action ended 14:42:43: InstallFinalize. Return value 1.
MSI (s) (BC:F8) [14:42:43:676]: Doing action: QtExec1
Action 14:42:43: QtExec1.
Action start 14:42:43: QtExec1.
MSI (s) (BC:F4) [14:42:43:682]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIC4A7.tmp, Entrypoint: CAQuietExec
MSI (s) (BC!BC) [14:42:43:690]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"[INSTALLLOCATION]XmlPreprocess.exe /i:web.config /e:[VARRADIOBUTTONENVIRONMENT] "'.
CAQuietExec: Error 0x8007007b: Command failed to execute.
CAQuietExec: Error 0x8007007b: CAQuietExec Failed
Action ended 14:42:43: QtExec1. Return value 3.
Action ended 14:42:43: INSTALL. Return value 3.
Property(S): StartIIS7ConfigTransaction = ScaConfigureIIs
And at the end when it dumps all the properties it shows this:
Property(S): VARRADIOBUTTONENVIRONMENT = QA
Property(S): VARTEXTSETTINGSFILENAME = Test1234.txt
Property(S): VerifyCurrentPropValueOfEnv = [VARRADIOBUTTONENVIRONMENT]
Here are fragments of my code. I just changed property ids to all-caps and added the secure="yes" based on another post I saw. I've tried with and without the Secure="yes".
<Property Id="VARRADIOBUTTONENVIRONMENT" Secure="yes">Dev</Property>
<Property Id="VARTEXTSETTINGSFILENAME" Secure="yes">C:\Path\SettingsFileGenerator.xml</Property>
...then later...
<Property Id="VerifyCurrentPropValueOfEnv" Value="[VARRADIOBUTTONENVIRONMENT]"/>
<Property Id="QtExecCmdLine" Value=""[INSTALLLOCATION]XmlPreprocess.exe /i:web.config /e:[VARRADIOBUTTONENVIRONMENT] ""/>
<CustomAction Id="QtExec1" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
<InstallExecuteSequence>
<Custom Action="QtExec1" After="InstallFinalize"><![CDATA[NOT(Installed)]]></Custom>
</InstallExecuteSequence>
At the end of the install, I see that XmlPreProcess.exe is installed in the installation directory.
Questions:
Is there something I'm doing wrong to get the values to substitute?
I'm using CAQuietExec because I was told it would log better errors and echo the output of the command window to the install log. I don't really care about not seeing the command window. I'm not sure how to find out what this means:
"CAQuietExec: Error 0x8007007b: Command failed to execute.". I can't tell if this is a WIX error trying to call XmlPreprocess.exe or if it got into XmlPreprocess and then threw the error.
Thanks,
Neal Walters
Looking at the log extract I think I can see the problem, you've quoted the entire command line, try this instead:
<Property Id="QtExecCmdLine" Value=""[INSTALLLOCATION]XmlPreprocess.exe" /i:"[INSTALLLOCATION]web.config" /e:[VARRADIOBUTTONENVIRONMENT]"/>
One of our MSI's has started failing with Error 2902. It'll get most of the way through the installation, pop an error box, and then back out the install. We haven't made any major changes to the installer since the last working version.
Running msiexec with logging turned on gives a more informative message:
Action 17:21:22: RegisterProduct. Registering product
Error 2902: Operation ixoFileCopy called out of sequence
This comes immediately after the "WriteRegistryValues" section. Does anyone know what causes the call to ixoFileCopy? I'm guessing the resolution will involve changing the sequence of the "RegisterProduct" step, but I'm not sure what it should proceed.
Thanks for any help!
It turns out that in our case this was happening due to a data file getting too big for MSI to handle without chunking the cab. This thread mentions the issue and one possible workaround.
I had the same error.
Apparently, there were files missing or corrupted (network error?). The problem has been solved after copying the whole folder again.
I've also seen this error when components are provided with blank guids.
e.g.
<Component Id="cmp_MyFailingComponent" Guid="">
<File Id="f_myFile"
Assembly=".net"
Source="C:\Program Files\MyFile.dll"
KeyPath="yes"/>
</Component>
I've seen this error when some of the database column fields are longer than the column width.
I had converted an MSI into an InstallShield project, made a few additions, and built a new MSI - it built without any errors. Installation then failed with error 2902.
The components that failed had component names longer than the allowed 72 characters. (see Component table) The original MSI worked fine despite having the long names, but I guess they caused InstallShield to improperly build the MSI somehow. Not InstallShield's fault, although I do think it should have raised an error during the build.