[wix-users] File Association: Using parameters in ProgId and Verb elements for files that already has a component Id created by HarvestDirectory

Shelly Horowitz shellyh at microsoft.com
Sun Jan 31 23:57:52 PST 2016


Hi,

I'm using HarvestDirectory target in my installer, which collects all of the files needed for the installation and gather it into a .wsx file.

I want to associate a file of a new type with an .exe file that is part of the installation (and therefore appears in the auto-created file list).
(i.e. whenever a file of this new type is opened - my .exe file will open it, and also the icon is declared in this exe file)

Therefore, in order to do so I'm using ProgId element as follows:
<ProgId Id="FileAssociation" Description="My file" Icon="MyApp.exe" IconIndex="1">
   <Extension Id="myfile" ContentType="myfile">
       <Verb Id="open" Command="Open" TargetProperty="$(var.AdditionalScriptsSourceDir)\MyApp.exe" Argument="%1"/>
   </Extension>
</ProgId>

I'm trying to associate myfile to be opened with $(var.AdditionalScriptsSourceDir)\MyApp.exe" , but it seems like it's not the way to pass an argument to TargetProperty, I receive this error:
"error LGHT0204: ICE03: Invalid format string; Table: Registry, Column: Value, Key(s)...."

Also the icon should be set from the same .exe file , but I don't see that there's a way to pass it as an argument once again. Or is it?

Perhaps there's a way to declare this file again, but without conflicting with the file entry that was auto created by heat?


Would appreciate your help,

-Shelly


More information about the wix-users mailing list