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

Cannot define RemotePayload #512

Closed
474D opened this issue Oct 19, 2018 · 4 comments
Closed

Cannot define RemotePayload #512

474D opened this issue Oct 19, 2018 · 4 comments

Comments

@474D
Copy link

474D commented Oct 19, 2018

Im not able to define remotepayload as in wix on wixsharp. If i define this package, i have to own its .exe in order to build otherwise i get error file not found, i want it to be downloaded only during setup, on wix i wuold just predefine remotepayload and it would work, but i am unable to define on wixsharp.
Error msg: Element 'Payload' missing attribute 'SourceFile' or child element 'RemotePayload'. Exactly one of those is required.

   new ExePackage("NetFx45Redist")
                {
                    InstallCommand = "/q /norestart /ChainingPackage [WixBundleName] /log [NetFx45FullLog].html",
                    RepairCommand = "/q /norestart /repair /ChainingPackage [WixBundleName] /log [NetFx45FullLog].html",
                    UninstallCommand = "/uninstall /q /norestart /ChainingPackage [WixBundleName] /log [NetFx45FullLog].html",
                    DetectCondition = "(Net4FullVersion = v4.5.50938) AND (NOT VersionNT64 OR (Net4x64FullVersion = v4.5.50938))",
                    InstallCondition = "(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Net4FullVersion >= v4.5.50938 OR Net4x64FullVersion >= v4.5.50938))",
                    Vital = true,
                    PerMachine = true,
                    Permanent = true,
                    Payloads = new Payload[]
                    {
                        new Payload()
                        {
                            Id = "NetFx45Redist",
                            Compressed = false,
                            DownloadUrl = "http://go.microsoft.com/fwlink/?LinkId=225702",
                        }
                    }
                },
Remote payload example:

 <RemotePayload
            Size="50352408"
            Version="4.5.50709.17929"
            ProductName="Microsoft .NET Framework 4.5"
            Description="Microsoft .NET Framework 4.5 Setup"
            CertificatePublicKey="BE931A1B869E4BB989C2B32D0C105204ECBEFB3D"
            CertificateThumbprint="8363887511B4835B79C383ECF06FC055B5839255"
            Hash="B2FF712CA0947040CA0B8E9BD7436A3C3524BB5D"/>

Example of what im using on wix, and unable to get on wixsharp
  <ExePackage
      InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx45FullLog].html&quot;"
      RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx45FullLog].html&quot;"
      UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx45FullLog].html&quot;"
      PerMachine="yes"
      DetectCondition="(Net4FullVersion = &quot;4.5.50938&quot;) AND (NOT VersionNT64 OR (Net4x64FullVersion = &quot;4.5.50938&quot;))"
      InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Net4FullVersion >= &quot;4.5.50938&quot; OR Net4x64FullVersion >= &quot;4.5.50938&quot;))"
      Id="NetFx45Redist"
      Vital="yes"
      Permanent="yes"
      Protocol="netfx4"
      DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=225702"
      LogPathVariable="NetFx45..FullLog"
      Compressed="no"
      Name="redist\dotNetFx45_Full_x86_x64.exe">
    <RemotePayload
        Size="50352408"
        Version="4.5.50709.17929"
        ProductName="Microsoft .NET Framework 4.5"
        Description="Microsoft .NET Framework 4.5 Setup"
        CertificatePublicKey="BE931A1B869E4BB989C2B32D0C105204ECBEFB3D"
        CertificateThumbprint="8363887511B4835B79C383ECF06FC055B5839255"
        Hash="B2FF712CA0947040CA0B8E9BD7436A3C3524BB5D"/>
  </ExePackage>
@oleg-shilo
Copy link
Owner

Currently WixShurp Bundle supports only default Payload. If you want to use RemotePayload you will need to add it with by injecting XML form post-build event. Something like this:

bootstrapper.WixSourceGenerated += (XDocument document) =>
{
    document.FindFirst("ExePackage")
            .AddElement("RemotePayload",
                       @"Size = 50352408;
                         Version = 4.5.50709.17929;
                         ProductName = Microsoft.NET Framework 4.5;
                         Description = Microsoft .NET Framework 4.5 Setup;
                         CertificatePublicKey = BE931A1B869E4BB989C2B32D0C105204ECBEFB3D;
                         CertificateThumbprint = 8363887511B4835B79C383ECF06FC055B5839255;
                         Hash = B2FF712CA0947040CA0B8E9BD7436A3C3524BB5D");
};

But I have made your post into a feature request so it will be implemented in the next release..

oleg-shilo pushed a commit that referenced this issue Oct 20, 2018
@474D
Copy link
Author

474D commented Oct 22, 2018

Thank you for the quick reply. But im still unable to assign it. See code below:

bootstrapper.WixSourceGenerated += (XDocument document) =>
            {
                document.Elements("ExePackage")
                    .Where(el => (string) el.Attribute("Id") == "Net45FW")
                    .Select(el => el.AddElement("RemotePayload", @"Size = 50352408;
                         Version = 4.5.50709.17929;
                         ProductName = Microsoft.NET Framework 4.5;
                         Description = Microsoft .NET Framework 4.5 Setup;
                         CertificatePublicKey = BE931A1B869E4BB989C2B32D0C105204ECBEFB3D;
                         CertificateThumbprint = 8363887511B4835B79C383ECF06FC055B5839255;
                         Hash = B2FF712CA0947040CA0B8E9BD7436A3C3524BB5D")); ;
            };
var net45Exe = new ExePackage("Net45")
            {
                Id ="Net45FW",
                InstallCommand = "/q /norestart /ChainingPackage [WixBundleName] /log [NetFx45FullLog].html",
                RepairCommand = "/q /norestart /repair /ChainingPackage [WixBundleName] /log [NetFx45FullLog].html",
                UninstallCommand = "/uninstall /q /norestart /ChainingPackage [WixBundleName] /log [NetFx45FullLog].html",
                Compressed = false,
                DownloadUrl = "http://go.microsoft.com/fwlink/?LinkId=225702",
                DetectCondition = "(Net4FullVersion = v4.5.50938) AND (NOT VersionNT64 OR (Net4x64FullVersion = v4.5.50938))",
                InstallCondition = "(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Net4FullVersion >= v4.5.50938 OR Net4x64FullVersion >= v4.5.50938))",
                Vital = true,
                PerMachine = true,
                Permanent = true,
            };`

Error:
error LGHT0103: The system cannot find the file 'Net45'.

@474D
Copy link
Author

474D commented Oct 22, 2018

was able to succeed iterating threw each element (but not each exePackage), maybe there is a better solution?

 document.Descendants().FirstOrDefault(x => (string) x.Attribute("Id") == "Net45Id").AddElement("RemotePayload", @"Size = 50352408;
                         Version = 4.5.50709.17929;
                         ProductName = Microsoft.NET Framework 4.5;
                         Description = Microsoft .NET Framework 4.5 Setup;
                         CertificatePublicKey = BE931A1B869E4BB989C2B32D0C105204ECBEFB3D;
                         CertificateThumbprint = 8363887511B4835B79C383ECF06FC055B5839255;
                         Hash = B2FF712CA0947040CA0B8E9BD7436A3C3524BB5D");

@oleg-shilo
Copy link
Owner

This is a temporary solution and the next release will have it as below:

new ExePackage(@"..\redist\dotNetFx40_Full_x86_x64.exe") 
{
    Compressed = true
    RemotePayloads = new[] 
    {
        new RemotePayload
        {
            ...
        }
          

The change is here: adbb7b1

oleg-shilo pushed a commit that referenced this issue Dec 1, 2018
- Fixed problem with locating latest (v3.11) WiX Toolset installed
- Issue #538: impossible rename file during installation; added `File.TargetFileName`
- Issue #536: External_UI/WinFormsSetup how to get properties
- Issue #531: Question: custom action and Embedded UI
- Issue #511: Compile error CustomDialog
- Issue #512: Cannot define RemotePayload
- Issue #484: Is ExecuteInTempDomain really necessary?
- Added `BalCondition`
- Added `CAValidation` enum - `InRemoteAppDomain, InCurrentAppDomain, Disabled`
- WixSharp.VS.ProjectTemplate: Release v1.6.0.0
- Updated to the new `WixSharp.UI.Runtime` structure.
- Code cleanup (mainly CodeMaid cleaning)
oleg-shilo pushed a commit that referenced this issue Dec 1, 2018
- Fixed problem with locating latest (v3.11) WiX Toolset installed
- Issue #538: impossible rename file during installation; added `File.TargetFileName`
- Issue #536: External_UI/WinFormsSetup how to get properties
- Issue #531: Question: custom action and Embedded UI
- Issue #511: Compile error CustomDialog
- Issue #512: Cannot define RemotePayload
- Issue #484: Is ExecuteInTempDomain really necessary?
- Added `BalCondition`
- Added `CAValidation` enum - `InRemoteAppDomain, InCurrentAppDomain, Disabled`
- WixSharp.VS.ProjectTemplate: Release v1.6.0.0
- Updated to the new `WixSharp.UI.Runtime` structure.
- Code cleanup (mainly CodeMaid cleaning)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants