My target is to auto-name the output msi file with version number in WIX 3.6 project. I find this link:
Automated installer version numbers for WiX, revisited but we have a slightly different scenario: we don't want to control our product version number by referencing to any assembly's version number. Instead, we just simply want to assign it in wix files. Specifically, I have a wxi file which defines a property like this:
<?define VersionNumber = "1.1.2000" ?>
As a result, I can use this VersionNumber variable anywhere inside our Product.wxs file. But since the easiest way to rename the output msi file seems to be adding a postbuild task in MSBuild, I must pass this VersionNumber out to the MSBuild project file. This is what stops me.
I tried the other way around, i.e., to define the VersionNumber constant in the MSBuild and use it inside WIX. It works fine except I must keep this constant the same for different Build/Platform combinations. We are building our software in VS IDE which means if we modify the version number in IDE's window, it would only apply to the specific Build/Platform combination and the other combinations will remain unchanged(I know if I am building from command line I can simply pass a version number to overwrite the existing one). And that is what I don't want to see. I like the idea to only define the version number in one place to avoid any possible mistake.
Any help will be appreciated!
Define the preprocessor variable after choosing "All Configurations" and "All Platforms" in the Build tab of the setup project properties.
You can achieve this by adding an element in your .wixproj to a project where you just keep the version number. You'd modify the .wixproj, but only once. And you can probably add this properties file to the .wixproj itself with a reasonable action (None?) so you can modify it from within the IDE.
Something like:
Version.properties
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<WhateverTheVersionPropertyNameIs>x.x.x.x</WhateverTheVersionPropertyNameIs>
</PropertyGroup>
</Project>
In your .wixproj file you'd add at the end
<Import Project="Version.properties"/>
Related
The company I work for has recently taken to generating MSI files with Wix. We're at the tail end of the process, but there's one more thing they need me to do.
We have an XML file with a snapshot of what binaries have gone into the install. However, the customers we deliver to will get somewhat confused about an extra useless file in the install.
Most everything that comes up when I search for 'Wix' and 'hide file' is focused on removing or deleting the files after install. I just need to hide this sucker though.
Is there a way to hide the file through HEAT or something? I can modify the file element in the WXS using XSL or Powershell if need be. Or do I need to resort to a custom action that calls cmd.exe to hide it?
You can try setting the file element's hidden attribute to yes. Taken from here:
Set to yes in order to have the file's hidden attribute set when it is installed on the target machine.
My text message is stuck to "Install My Product to:"
How can I change this?
("My Product" is the name of my product and the string above is resolved based on the Name attribute in my Product.wxs).
I have 2 dialogs and the second requires a different message.
Some text on the built-in dialogs can be changed with variables specified in the localization file for your language. This is a simpler task than if you are trying to change text that is not kept in a variable.
This process is documented here.
However, if that's the case, the recommended way to change the dialog on the install page is to make a copy of and change the template file(s) provided with the WiX installation.
Copy the relevant .wxs files from your WiX dialog extension set (you will need to make sure you installed the WiX source) you want to modify and copy the file that specifies the UI extension name. Modify it to suit your needs and change the names.
When you compile your installer, you will use your new extension name (referring to your modified dialog set) and tell candle/light where your modified .wxs files are.
This process has some good documentation here and here.
Following the entire tutorial at the second link should get you pretty far.
Good luck
While using VS (2010), I used to be able to add an image as a resource simply by going to the Resource view and then: Right click project > Add > Resource > Import.
I even asked a question about how to then load it: Loading an image from a resource embedded in a dll, but that changed for some reason.
Now when I try the same thing and save the .rc file, I get this message:
"The resource script FILE_PATH.rc was not created using Microsoft
Visual Studio. Comments, macros, preprocessor directives, and
conditionally included information may be modified and/or removed from
this file during the build process. Replace existing file?"
Even if I click "yes" (in order to just test things) then I get all kind of error messages at compile time:
ResourceCompile:
gen\firebreathWin.rc(8): error RC2144: PRIMARY
LANGUAGE ID not a number
gen\firebreathWin.rc(16): error RC2135: file not found VS_VERSION_INFO
etc...
I have two questions:
What is the correct way to add an image resource which will be added to the compiled plugin using CMake? I searched about it and couldn't find any helping information.
What can be the cause for this change in behavior? since I was able to use the same exact steps before and it worked.
Thanks.
First of all, I wouldn't do this; instead, I'd just put the file in the same directory as your DLL and use the path of DLL to find it.
That said, the "correct" way to do this would be to see what changes are made to the .rc file when you add it in the IDE, copy the .rc file from gen_templates/ in the root of the firebreath directory into your project, and then make those changes to your copy of the file. Any changes you make to the generated file will be overridden any time cmake is run again, which can happen any time your cmake files (CMakeLists.txt, *.cmake) change.
Using MSBuild 4.0 (framework version v4.0.30319), I pass properties to MSBuild when calling a project file thus:
MSBuild Build.csproj /p:Property1=Value1
Is it possible to use the /pp (preprocess file) option to capture this in the generated file?
The reason I ask is that we have around 20 properties already set within an imported project file ... out of which we will normally override less than 10. The first time the Build project is run, the properties to override are passed via command line (by a batch file). The properties will (naturally) not have the modified values if the project is launched in the IDE. I tried placing them in an msbuild.rsp file adjacent to the project, and those do come into effect when MSBuild is invoked. But I want them to persist in an imported project file such that the IDE also knows the updated values. The imported file is dispensable and therefore I was trying to have the values persist inside it.
Thanks in advance for any pointers.
I am trying to convert a VB.NET web site project to a web application project, yet the in web application project, my code-behind files are not visible unless I set the solution explorer "show all files" option. Why is this? What setting can I change so that my code behind files are always visible?
You can set VS to always show all files. That's the best soluution although a really ugly way to avoid this would be to rename the files for the code behind.
I know this is a bit of an old question, but it's the top result on Google and I found an alternate solution.
Open your .vbproj file for the project in a text editor, and search for your codebehind file's name. You'll find that it looks something like this:
<Compile Include="dashboard\index.aspx.vb">
<DependentUpon>index.aspx</DependentUpon>
<SubType>ASPXCodebehind</SubType>
</Compile>
If you simply remove the DependentUpon tag, everything will still work properly, but both files will show up in Visual Studio, as desired. So my final version would look like this:
<Compile Include="search\index.aspx.vb">
<SubType>ASPXCodeBehind</SubType>
</Compile>
It takes a little bit of manual editing but it works for me. Alternatively if you manually rename/edit your files into a page/codebehind format after creating regular class files, they will appear as wanted in the project without having to resort to "Show All Files."