Hi all,

 

I'm trying to create a customisable msi. This can be done by reading a
file or passing command line parameters on the moment of install. It
works great in almost every way:

-         Creating a custom entry in the registry based on the passed
parameter

-         Filling in this entry with a custom value

-         The argument of the shortcut pointing to the executable is
succesfully based on the parameter

 

The only problem I have is that the name attribute of this shortcut
cannot interpret this parameter and will use the name of the parameter
in stead of the value given to this parameter. To make things clear I
wrote a little wxs project to demonstrate the problem.

 

Sample wxs file (Test.wxs):

<?xml version="1.0" encoding="windows-1252"?>

 

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>

  <Product Id="2FF5E8BC-D564-4CCF-A3AD-B07D3FBBA8F6"

           Language="1033" Codepage="1252"

           Manufacturer="Manufacturer"

           Name="Test"

           Version="1.0.0.0"

           UpgradeCode="018A5680-5D63-4381-8084-ED4C21FADDB3" >

    <Package Compressed="yes"

             Keywords="Installer"

             Manufacturer="Manufacturer"

             Description="Test installer"

             InstallerVersion="200" Languages="1033" />

    <UI />

 

    <Media Id="1" Cabinet="sample.cab" EmbedCab="yes" DiskPrompt="CD-ROM
#1" />

 

    <Property Id="DiskPrompt" Value="Test installation" />

 

    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="ProgramFilesFolder" >

        <Directory Id="INSTALLDIR" Name="Testing">

          <Component Id="MAIN"
Guid="E92B83AF-75DB-4EC2-8519-E9448C817446">

 

            <File Id="Foo"

                  Name="Foo.exe"

                  DiskId="1"

                  Source="Foo.exe"

                  KeyPath="yes"

                  Vital="yes">

            </File>

            <RegistryValue Id="RegTest"  Root="HKLM"
Key="SOFTWARE\Testing\TH_[NAME]" Name="Word"  Action="write"
Type="string" Value="[NAME]" />

          </Component>

          

          <Component Id="SHORTCUT"
Guid="4E4708E8-B3BD-414D-93DB-B6108DBBECE7">

            <CreateFolder/>

            <RegistryKey Root="HKCU" Key="Software\Testing\TH[NAME]"

                       Action="createAndRemoveOnUninstall">

            <RegistryValue Name="[NAME]" Value="1" Type="integer"
KeyPath="yes"/>

          </RegistryKey>

 

            <Shortcut Id="Test_shortcut"

                      Directory="TestDir"

                      Name="Launch [NAME]"

                      Arguments="TH_[NAME]"

                      WorkingDirectory="INSTALLDIR"

                      Target="[#Foo]"

                      Advertise="no" />            

          </Component>

        </Directory>

      </Directory>

 

      <!-- Directory structure for the menu Start -->

      <Directory Id="ProgramMenuFolder" >

        <Directory Id="MenuDir" Name="Company">

          <Directory Id="TestDir" Name="Test">

            <Component Id="DEL_TESTDIR"
Guid="F012B1A1-AF63-49BD-AA32-E61BFBD4703B">

              <RemoveFolder Id="REMOVE_TESTDIR" On="uninstall" />

              <RegistryValue Id="RM_TESTDIR"

                             Key="SOFTWARE\Testing\TH[NAME]"

                             KeyPath="yes"

                             Root="HKCU"

                             Type="string"

                             Value="TESTDIR" />

            </Component>

          </Directory>

          <Component Id="DEL_MenuDir"
Guid="AAA4BA3F-8187-4920-834A-0B6A2BC2C819">

            <RemoveFolder Id="REMOVE_MenuDir" On="uninstall" />

            <RegistryValue Id="RM_MenuDir"

                           Key="SOFTWARE\Testing\TH[NAME]"

                           KeyPath="yes"

                           Root="HKCU"

                           Type="string"

                           Value="MenuDir" />

          </Component>

        </Directory>

      </Directory>

    </Directory>

 

    <Feature Id="Complete" Level="1">

      <ComponentRef Id="MAIN" />

      <ComponentRef Id="DEL_TESTDIR" />

      <ComponentRef Id="DEL_MenuDir" />

      <ComponentRef Id="SHORTCUT" />

    </Feature>

    

  </Product>

</Wix>

 

 

Msiexec /i Test.msi NAME=APPFOO

 

Result:

Correct:

-         Registry:

o        HKEY_LOCAL_MACHINE/SOFTWARE/Testing/TH_APPFOO: Word = APPFOO

-         Shortcut:

o        Properties of shortcut: at the end of target the argument is
correct filled in
"C:\Program Files\Testing\Foo.exe" TH_APPFOO

 

Not correct:

-         Shortcut:

o        The name of the shortcut isn't correct
Start => Programs => Compagny => Test => "Launch [NAME]"

 

 

I tested it with WiX toolset version 3.0.4603.0 and 3.0.4930.0 with both
the same result.

How is it possible to make the name of this shortcut customizable?
Probably it won't interpret the passed parameter... 

Thanks for your help!

 

Best regards,

Geert Gerits

 

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to