Building WiX x86 / x64 using Platform Attribute

I am using the following define to make my script setup flexible according to my build environment.

<?if $(var.Platform)=x64 ?>

<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?define win64Flag = "yes"?>
<?define TargetConfigurationPath = "bin\x64\Release"?>

<?else ?>

<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?define win64Flag = "no"?>
<?define TargetConfigurationPath = "bin\x86\Release"?>
<?endif ?>

      

in detail I remember the variable win64Flag which I use in every attribute of Win64 components. I also use the platform in the "Platform" attribute of the packages. But to get back to the Win64 attribute, I use this variable like this:

Win64="$(var.win64Flag)"

      

And I always get a warning that the use of this operator in the YesNoType attribute is invalid.

I am creating this stuff using candle.exe with this call:

candle.exe -ext WixUtilExtension -dPlatform=x86 "Deployment\WiX Setup Project\SetupScript.wxs" -out "Deployment\TempBuildOutput\SetupScript x86.wixobj"

light.exe -ext WixUIExtension -ext WixUtilExtension "Deployment\TempBuildOutput\SetupScript x86.wixobj" -out "Deployment\TempBuildOutput\Installer_x86.msi"

      

I have a CustomAction in my script that automatically launches the application if the installation is complete. This works fine on x64 assemblies, but not x86 assemblies. This is why I think there might be something wrong with the Win64 attribute, or better, in the way I use it.

But in my thoughts, something should be right with this code because the files are installed in the appropriate folder on x64 (Program Files) and x86 (Program Files (x86)). But I am asking myself why my applications are not starting after the installation is complete.

I am working on Windows x64, could this be the reason why I am not running my x86 autostart applications?

Is there a way to resolve the warning about my Win64 attribute usage?

+3


source to share


1 answer


I can't tell you why your application won't launch after installation is complete without additional information to diagnose the problem, but I can tell you why you are getting an invalid attribute warning.

Invalid attribute warning is generated by Visual Studio if you want to compile your project on the command line, which you will not see, you will see a warning. The Visual Studio XML Editor performs automatic XML schema validation if it recognizes the schema of your XML document. Wix XML Schema defines the values ​​allowed for an attribute Win64

as yes

or no

. Visual Studio sees that you do not have one of these values ​​and will kindly advise that you are not following a particular pattern. Wix, on the other hand, first preprocesses the document and replaces the violation value with the value you define in your included file, making it such that the document passes schema validation.



In short, this warning is probably not the cause of the problem you are seeing.

+2


source







All Articles