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

Warning WIX5437: It is no longer necessary to define the standard directory 'DesktopFolder' #1655

Open
chuongmep opened this issue Oct 10, 2024 · 1 comment

Comments

@chuongmep
Copy link

Hi eveyone and developers !

How can we upgrade code to fix warning :

 warning WIX5437: It is no longer necessary to define the standard directory 'DesktopFolder'. Use the StandardDirectory element instead.
 warning WIX5437: It is no longer necessary to define the standard directory 'ProgramMenuFolder'. Use the StandardDirectory element instead.

It look like I'm using diffrence way to follow up with latest version, any help is appreciated, this is my code effected

WixEntity[] CreateShortcut(string applicationName, string exeFileName)
{
    return new WixEntity[]
    {
        // Shortcut on the Desktop
        new Dir(@"%Desktop%",
            new ExeFileShortcut(applicationName, Path.Combine("[INSTALLDIR]", exeFileName), arguments: "")
            {
                WorkingDirectory = "[INSTALLDIR]",
                IconFile = @"./Resources/icon.ico",
            }),

        // Shortcut in the Program Menu
        new Dir(@"%ProgramMenu%",
            new ExeFileShortcut(applicationName, Path.Combine("[INSTALLDIR]", exeFileName), arguments: "")
            {
                WorkingDirectory = "[INSTALLDIR]",
                IconFile = @"./Resources/icon.ico",
            })
    };
}
@chuongmep chuongmep changed the title warning WIX5437: It is no longer necessary to define the standard directory 'DesktopFolder' Warning WIX5437: It is no longer necessary to define the standard directory 'DesktopFolder' Oct 10, 2024
@Torchok19081986
Copy link

Torchok19081986 commented Oct 10, 2024

moring, this reference to Wix Toolset v4. WixSharp in V4 do AOT Compilation. According to website of Wix Toolseet V4 is now Enum. https://wixtoolset.org/docs/schema/wxs/standarddirectorytype/#enumeration-values
Dont know, if oleg has already implemented it. Maybe this should be enchancement suggestion.

if you create project from template for WixV4 for MSI Creation, you got

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
  <Fragment>
    <StandardDirectory Id="ProgramFiles6432Folder"> <---this is different in v3. 
      <Directory Id="INSTALLFOLDER" Name="!(bind.Property.Manufacturer) !(bind.Property.ProductName)" />
    </StandardDirectory>
  </Fragment>
</Wix>

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

No branches or pull requests

2 participants