1

I am developing a wix code to create a msi. i have added all the components and libraries to my wix project.But,i am not able to create a msi as i need.Please help me out.Here is my code,

<?xml version='1.0' encoding='UTF-8'?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<Product Name='SmartViewer'
          Id="*"
          Language='1033'
          Codepage='1252'
          Version='1.0.0'
          UpgradeCode='9C5E4073-EFDE-419B-935D-CE2632BC560E'>

    <Package Keywords='Installer,MSI'
             InstallerVersion='100'
             Languages='1031'
             Compressed='yes'
             SummaryCodepage='1252' />

    <Media Id="1" Cabinet="myapp.cab" EmbedCab="yes" />

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="MyProgramDir" Name="myproject" >
                <Directory Id="INSTALLFOLDER" Name="proj1" />
            </Directory>
        </Directory>

    <DirectoryRef Id="INSTALLFOLDER">
        <Component Id='MainExecutable' Guid='*'>
            <File Id='ExecutableFile' Name='mv.exe' DiskId='1' Source='mv.exe' KeyPath='yes'/>
        </Component>
        <Directory Id="imageformats" Name="imageformats">
            <Component Id='jpeg4Library' Guid='*'>
                <File Id='jpeg4' Name='jpeg4.dll' DiskId='1' Source='jpeg4.dll' KeyPath='yes' />
            </Component>
        </Directory>

        <Component Id='Network4Library' Guid='*'>
            <File Id='Network4' Name='Network4.dll' DiskId='1' Source='Network4.dll' KeyPath='yes' />
        </Component>

        <Component Id='Multimedia4Library' Guid='*'>
            <File Id='Multimedia4' Name='Multimedia4.dll' DiskId='1' Source='Multimedia4.dll' KeyPath='yes' />
        </Component>

        <Component Id='QtGui4Library' Guid='*'>
            <File Id='Gui4' Name='Gui4.dll' DiskId='1' Source='Gui4.dll' KeyPath='yes' />
        </Component>

        <Component Id='Designer4Library' Guid='*'>
            <File Id='Designer4' Name='Designer4.dll' DiskId='1' Source='Designer4.dll' KeyPath='yes' />
        </Component>

        <Component Id='Core4Library' Guid='*'>
            <File Id='Core4' Name='Core4.dll' DiskId='1' Source='Core4.dll' KeyPath='yes' />
        </Component>


        <Component Id='libmfxsw32Library' Guid='*'>
            <File Id='libmfxsw32' Name='libmfxsw32.dll' DiskId='1' Source='libmfxsw32.dll' KeyPath='yes' />
        </Component>

        <Component Id='libiomp5mdLibrary' Guid='*'>
            <File Id='libiomp5md' Name='libiomp5md.dll' DiskId='1' Source='libiomp5md.dll' KeyPath='yes' />
        </Component>

        <Component Id='ippcore7.1Library' Guid='*'>
            <File Id='ippcore7.1' Name='ippcore-7.1.dll' DiskId='1' Source='ippcore-7.1.dll' KeyPath='yes' />
        </Component>

        <Component Id='ippccw77.1Library' Guid='*'>
            <File Id='ippccw77.1' Name='ippccw7-7.1.dll' DiskId='1' Source='ippccw7-7.1.dll' KeyPath='yes' />
        </Component>

        <Component Id='ippccv87.1Library' Guid='*'>
            <File Id='ippccv87.1' Name='ippccv8-7.1.dll' DiskId='1' Source='ippccv8-7.1.dll' KeyPath='yes' />
        </Component>

        <Component Id='ippccs87.1Library' Guid='*'>
            <File Id='ippccs87.1' Name='ippccs8-7.1.dll' DiskId='1' Source='ippccs8-7.1.dll' KeyPath='yes' />
        </Component>

        <Component Id='ippccp87.1Library' Guid='*'>
            <File Id='ippccp87.1' Name='ippccp8-7.1.dll' DiskId='1' Source='ippccp8-7.1.dll' KeyPath='yes' />
        </Component>

        <Component Id='ippccg97.1Library' Guid='*'>
            <File Id='ippccg97.1' Name='ippccg9-7.1.dll' DiskId='1' Source='ippccg9-7.1.dll' KeyPath='yes' />
        </Component>

        <Component Id='ippcc7.1Library' Guid='*'>
            <File Id='ippcc7.1' Name='ippcc-7.1.dll' DiskId='1' Source='ippcc-7.1.dll' KeyPath='yes' />
        </Component>

        <Component Id='EULALibrary' Guid='*'>
            <File Id='EULA' Name='EULA.rtf' DiskId='1' Source='EULA.rtf' KeyPath='yes' />
        </Component>
    </DirectoryRef> 


    <Directory Id="ProgramFilesFolder">
        <Directory Id="MyProgramDir" Name="myproj" >
                <Directory Id="INSTALLFOLDER" Name="proj1" /
                    <Component Id="TextFileComponent" Guid="*">
                        <File Id="TextFile" Name="Logs.txt" DiskId="1"
                              Source="Logs.txt" KeyPath="yes" />
                    </Component>
        </Directory>
    </Directory>

    <Directory Id="DesktopFolder">
        <Component Id="ExecutableFileShortcutComponent" Guid="*">
            <Shortcut Id="ExecutableFileShortcut" Name="smart viewer" 
                  Description="Shortcut To Executable File"
                  Target="[INSTALLFOLDER]mv.exe" />
    </Directory>

    <Directory Id="ProgramMenuFolder">
        <Directory Id="MyProgramDir" Name="myproj">
            <Component Id="ExecutableFileShortcutComponent" Guid="*">
                <Shortcut Id="ExecutableFileShortcut" Name="smart viewer"
                      Description="Shortcut To Executable File"
                      Target="[INSTALLFOLDER]mv.exe" />

        </Component>
     </Directory>

  </Product>
 </Wix>

The components are not getting the dll path.I tried passing the path to source in file id,still i find the same issue.Looking forward for a good suggestion.

8
  • What error are you getting? Also I see you are missing the feature tag which you would need to install your files..:) Commented Feb 22, 2013 at 9:33
  • The components are not getting added.It is not finding the source path in file id. Commented Feb 22, 2013 at 11:18
  • Is it still not finding them when specifiying the full path? Commented Feb 22, 2013 at 12:16
  • @jasonbourne How could you verify that components aren't added when you failed to create the MSI?
    – harper
    Commented Feb 22, 2013 at 15:10
  • I get a error of file not found, which i feel is contrary to files are not been added. I have no idea about the way of coding in XML.Suggest me on this. Commented Feb 23, 2013 at 4:57

2 Answers 2

1

You need to reference the full path to the files:

<File Id="Microsoft.Practices.Unity"
      Name="jpeg4.dll"
      Source="$(var.BuildOutputDir)\jpeg4.dll" />

where $(var.BuildOutputDir) is the full path to a folder. If these files are in the output of another referenced project then you can use $(var.OtherProject.TargetDir)

1
  • If this is the correct answer please mark it so that others can easily see it, and I get the recognition! ;) Commented Feb 23, 2013 at 11:36
0

Your file does not contain valid XML. The following fragment is broken.

<Directory Id="ProgramFilesFolder">
    <Directory Id="MyProgramDir" Name="myproj" >
            <Directory Id="INSTALLFOLDER" Name="proj1" /
                <Component Id="TextFileComponent" Guid="*">
                    <File Id="TextFile" Name="Logs.txt" DiskId="1"
                          Source="Logs.txt" KeyPath="yes" />
                </Component>
    </Directory>
</Directory>

The line

            <Directory Id="INSTALLFOLDER" Name="proj1" /

should be

            <Directory Id="INSTALLFOLDER" Name="proj1" >

There is one </Directory> missing. You should also add </Component> at two positions. Try WiXEdit that points to invalid XML when it loads a .WXS file.

Additionally you should add a <feature>.

1
  • You typed all the code in the question? You're a hero! Please keep in mind there are more unbalanced XML nodes.
    – harper
    Commented Feb 22, 2013 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.