Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Votive thinks BindInputPaths are content #4493

Closed
wixbot opened this issue Aug 8, 2014 · 2 comments
Closed

Votive thinks BindInputPaths are content #4493

wixbot opened this issue Aug 8, 2014 · 2 comments
Milestone

Comments

@wixbot
Copy link

wixbot commented Aug 8, 2014

I have a Bootstrapper .wixproj where I wanted to add BindInputPaths, so I added

<ItemGroup>
    <BindInputPaths Include="absolute\path\to\folder" />
</ItemGroup>

This made VS2013/WiX 3.9.805 unable to load the project.

error: InvalidParameter.  Parameter name: CreateFolderNodes path.

After looking through the code, the problem was that the path was absolute and outside of the project folder, so I made the path relative.

src/Votive/votive2010/vssdk/projectnode.cs
    /// <summary>
    /// Walks the subpaths of a project relative path and checks if the folder nodes hierarchy is already there, if not creates it.
    /// </summary>
    /// <param name="strPath">Path of the folder, can be relative to project or absolute</param>
    public virtual HierarchyNode CreateFolderNodes(string path)
    {
        if (String.IsNullOrEmpty(path))
        {
            throw new ArgumentNullException("path");
        }

        if (Path.IsPathRooted(path))
        {
            // Ensure we are using a relative path
            if (String.Compare(this.ProjectFolder, 0, path, 0, this.ProjectFolder.Length, StringComparison.OrdinalIgnoreCase) != 0)
                throw new ArgumentException(SR.GetString(SR.InvalidParameter, CultureInfo.CurrentUICulture), "CreateFolderNodes path");

            path = path.Substring(this.ProjectFolder.Length);
        }

Now that VS could load the project, I saw that in Solution Explorer the folder was showing up as an item of the project with a warning symbol and link symbol. I noticed that the WiX toolset projects have their BindInputPaths in a .props file, so I tried moving the BindInputPaths into a .props file and import that in my .wixproj. That made Votive stop showing it, allowing me to change the path back to absolute.

Votive shouldn't be treating BindInputPaths as content.

Originally opened by rseanhall

@wixbot
Copy link
Author

wixbot commented Dec 18, 2015

I just got this error message now after having edited the WiX project that outputs an msi file. I'm on version 3.9.1208.0. After reading this, I'm still not sure why I start getting this error now. After restoring my wixproj file from SVN, I still get the error message.

Originally posted by eloekset

@wixbot
Copy link
Author

wixbot commented Dec 18, 2015

As a comment to my previous comment, my issue is now solved, and I can load my WiX project again. I don't know exactly what caused the error, but I found that it was somewhat related to a reference to %(AssemblyVersion.Version) in an out of scope PropertyGroup. This means it was not directly related to WiX. I changed my code to use the CreateProperty task, like shown below:

<GetAssemblyIdentity AssemblyFiles="..\MyProductName\bin\$(Platform)\$(Configuration)\MyAssembly.exe">
  <Output TaskParameter="Assemblies" ItemName="AssemblyVersion" />
</GetAssemblyIdentity>
<CreateProperty Value="..\setup\MyProductName-%(AssemblyVersion.Version).msi">
  <Output TaskParameter="Value" ItemName="AssemblyToSign"/>
</CreateProperty>
<Copy SourceFiles=".\bin\$(Configuration)\MyProductName.msi" DestinationFiles="@(AssemblyToSign)" />

This made it possible to access the AssemblyToSign property outside the target in which it was defined.

Originally posted by eloekset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant