-1

Environment: Windows 7 x86 SP1, Wix Toolset 3.10

Below is the installer wxs ignoring the INSTALLDIR.

Installer wxs ignoring INSTALLDIR

Here is the WiX XML:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="HelloWix Sample 1.0" Language="1041" Version="1.0.0" 
           Manufacturer="CM" UpgradeCode="PUT-GUID-HERE" Codepage="932">
    <Package Description="Simple Message to standard output" 
             Comments="This installer database contains the logic and data required
     to install HelloWix Sample." InstallerVersion="200" Compressed="yes"
     SummaryCodepage="932" />
    <Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder" Name="PFiles">
        <Directory Id="hellowix" Name="hellowix">
          <Component Id="HelloWix.cmd" Guid="*">
            <File Id="HELLOWIX.CMD" Name="HelloWix.cmd" Source="HelloWix.cmd" />
          </Component>
        </Directory>
      </Directory>
    </Directory>
    <Feature Id="DefaultFeature" Title="Main Feature" Level="1">
      <ComponentRef Id="HelloWix.cmd" />
    </Feature>
    <UI />
    <UIRef Id="WixUI_InstallDir" />
    <Property Id="WIXUI_INSTALLDIR" Value="hellowix" />

    <!--Added the following line:-->
    <Property Id="INSTALLFOLDER" Secure="yes" />

  </Product>
</Wix>

I think it is a related topic of http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Installer-ignores-InstallDir-directory-change-td6677782.html. So I added only one line; to the next line of Property Id="WIXUI_INSTALLDIR" as shown above:

    <!--Added the following line:-->
    <Property Id="INSTALLFOLDER" Secure="yes" />

Adding property

Then my installer got Error Code 2343...What's wrong?

illuminate33
  • 117
  • 1
  • 9
  • My reference is Japanese site below: http://www.02.246.ne.jp/~torutk/windows/wixandwixedit.html – illuminate33 Dec 25 '17 at 13:01
  • Before trying anything else, can you try to change the UI to this: ```` instead of ````. I believe there are some bugs in some dialog sets, but I am not sure. Please try this quickly first. – Stein Åsmul Dec 26 '17 at 21:40
  • illuminate33 - your question was very ill formatted - hence the downvotes I guess. I have attempted to correct it to display OK. I took out some duplicated WiX XML sections and enabled the pictures to show. Please review the changes and familiarize yourself with how this HTML editor works for the future. **Never post any hard coded GUIDs!** Also, please try the suggestion I added above with WixUI_Mondo. Chris Painter told me once to use that dialog set when I had a problem with a different dialog set. I can't recall what the problem was. In the mean time I will check that error code. – Stein Åsmul Dec 26 '17 at 21:59
  • First, thank you very much for correcting my post, @SteinÅsmul. I will try WiXUI_Mondo. – illuminate33 Dec 27 '17 at 13:02
  • Second, frankly speaking, I don't understand why I should not post "any hard coded GUIDs"...probably it derives from my shameful lack of knowledge of the importance... – illuminate33 Dec 27 '17 at 13:29
  • Sorry about that illuminate33, I ran out of space to explain why in that comment. Posting hard coded GUIDs online means they can be copied and used by others in their own source files, and this defeats the whole purpose of GUIDs: they should be globally unique. Hence you should remove them from your WiX sources (or other sources) posted online. Sometimes you need to post a known GUID to use for operations such as uninstall or known Microsoft COM servers, etc... These can also be copied, but GUIDs in a WiX source are even easier to copy and compile for someone else and serious problems result. – Stein Åsmul Dec 27 '17 at 13:51
  • Thank you again for your kind advice. I have found the Wix tutorial article warning same thing as yours. – illuminate33 Dec 28 '17 at 02:50
  • How did you go with this? I am wondering whether the solution was simply the dialog set or if it is a more involved problem? – Stein Åsmul Dec 28 '17 at 16:22
  • @Stein Åsmul I'm afraid I have enough space to explain what I want to make future in that comment. (Whole classic ASP.NET website installer, including Adding Server Roles and Features, SQL Server install and making schema) What I do here is poor first wrong step... Probably I will make another post soon for this topic. Thank you. – illuminate33 Dec 29 '17 at 00:46

2 Answers2

0

You can look up Windows Installer Error Messages on MSDN.

Error 2343 means "Specified path is empty". See link above, or get hold of msi.chm from your Windows SDK installation (search under ProgramFiles). It is very practical to have that help file available for quick retrieval of other information and MSI SDK information. I believe there is a copy of it included with WiX as well in its installation folder.


As written in the comment, please try to set the dialog set to use <UIRef Id="WixUI_Mondo" /> instead of your current setting of <UIRef Id="WixUI_InstallDir" />. I believe there may be some bugs in some of these dialog sets. I was told to use Mondo back in the day, and I remember the problem I experienced disappeared. I can not recall what the problem was though.

Please give that a go first, and I will "evolve" this answer if you add new information to your question with the test results.

Perhaps also see this answer I wrote for a different question. It is very similar in that it is a minimal WiX file used to compile a test MSI and it uses the Mondo GUI: WiX installer msi not installing the Winform app created with Visual Studio 2017.


It is possible that your problem is related to the Japanese system you are on. If so, it is crucially important that you help the WiX creators resolve the problems reliably for all users.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • As a newbie, I want to follow your suggestion that WixUI_Mondo is better using and avoid "WixUI_InstallDir"(which included InstallDirDlg that seems to serve my future purpose when I saw it in the sample webpage) – illuminate33 Dec 27 '17 at 13:46
  • Please do try that out, and let us know if it is an acceptable workaround for you. Are you also making a Burn bundle? This is WiX's way to run several MSI files or EXE files in sequence with its own GUI which effectively suppresses the GUI from each individual MSI file. This allows you to install several components in one operation (so several MSI files can be installed in sequence and show up in Add/Remove Programs as one "product"). – Stein Åsmul Dec 27 '17 at 13:54
  • If I understand correctly the function of "Burn", it bundles together several existing msi files. Currently I have only several Windows batch files, a powershell script, a SQL Server installer using Customer's license, and the asp.net program itself. – illuminate33 Dec 29 '17 at 00:57
0

If you have another system (or virtual machine) on which you can test this, then do so. Using the WiX source, this issue is not reproducible on my Windows 10 x64 English system. Also ICE validation reports no errors.

If it works on another system then your test system is most likely damaged in some way, and the most likely cause is that the Shell Folders entries are incorrect or damaged somewhere. The only directory this really being used is the 32-bit ProgramFilesFolder, so that's perhaps broken somewhere. I've seen this problem before where the values of the standard directory locations are broken in some way, and when Windows Installer evaluates them they become empty, hence the 2343 error.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
  • Thank you for your advice, @PhilDW. I will try on another system (x64 machine). – illuminate33 Dec 28 '17 at 03:04
  • I'm afraid I cannot report exact contents of the verification...orz 1) Win 7 x64 result: (Without Secure Tag) Error 2343.(With Secure Tag) Error 2343. 2)Win 7 x64 result, removing Japanese Language(No Language attribute, No code page attribute): (Without Secure Tag) No Error, ignoring the INSTALLDIR.(With Secure Tag) No Error, ignoring the INSTALLDIR. – illuminate33 Dec 28 '17 at 08:41