Trying to get hyperlink license to work...

Aug 7, 2013 at 9:04 PM
Hi Neil,

The hyperlink is there but clicking on it does nothing... (if I add the payload for the license file, I get a Bad Image error: <path to License.htm> is either not designed to run on Windows or contains an error. blah.....

Bundle.wxs:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
     xmlns:net="http://schemas.microsoft.com/wix/NetFxExtension"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <?include $(var.SolutionDir)Include\Variables.wxi ?>
  <Bundle Name="$(var.ProductName)"
          Version="$(var.ProductVersion)"
          Manufacturer="$(var.ProductCompany)"
          UpgradeCode="$(var.UpgradeCode)"
          DisableModify="yes"
          DisableRemove="no"
          HelpTelephone="613-820-5111"
          HelpUrl="http://www.titus.com"
          AboutUrl="http://www.titus.com/support/index.php"
          Copyright="Copyright © 2003 - 2013 TITUS, Inc. All Rights Reserved."
          IconSourceFile="$(var.resourcePath)\MessageClassification.ico"
          SplashScreenSourceFile="$(var.resourcePath)\Splash.bmp">
    <BootstrapperApplicationRef Id="WixExtendedBootstrapperApplication.HyperlinkLicense">
      <bal:WixExtendedBootstrapperApplication
        SuppressOptionsUI="yes"
        LicenseFile="$(var.resourcePath)\License.htm"
        SuppressRepair="yes"
        SuppressDowngradeFailure="yes"
        LaunchTarget="$(env.SystemDrive)\inetpub\wwwroot\wss\VirtualDirectories\TITUSWebAdministration\LaunchWebSite.vbs"
        LogoFile="$(var.resourcePath)\logo.png"/>
<Payload Id="LicenseFile" Name="$(var.resourcePath)\License.htm" SourceFile="$(var.resourcePath)\License.htm"/>
    </BootstrapperApplicationRef>
    <Variable Name="SERVICESLOGLEVEL" Type="string" bal:Overridable="yes" Value="WARN"/>
    <Variable Name="CONFIGUTILLOGLEVEL" Type="string" bal:Overridable="yes" Value="INFO"/>
    <WixVariable Id="WixExtbaLicenseUrl" Value="#(loc.License)"/>
    <WixVariable Id="WixExtbaThemeXml" Value="$(var.SolutionDir)HyperlinkTheme.xml" />
    <WixVariable Id="WixExtbaThemeWxl" Value="$(var.SolutionDir)HyperlinkTheme_Enterprise.wxl" />
HyperlinkTheme_Enterprise.wxl
<String Id="License">$(var.resourcePath)\License.htm</String>
HyperlinkTheme.xml:
<Page Name="Install">
    <Text X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.InstallHeader)</Text>
    <Text X="11" Y="-11" Width="-11" Height="-129" FontId="3" DisablePrefix="yes">#(loc.InstallMessage)</Text>
    <Button Name="RadioButton1" X="120" Y="190" Width="-11" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="no" HexStyle="0x000009">#(loc.InstallRadioButton1)</Button>
    <Button Name="RadioButton2" X="120" Y="210" Width="-11" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="no" HexStyle="0x000009">#(loc.InstallRadioButton2)</Button>
    <Button Name="RadioButton3" X="120" Y="230" Width="-11" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="no" HexStyle="0x000009">#(loc.InstallRadioButton3)</Button>
    <Hypertext Name="EulaHyperlink" X="60" Y="260" Width="-11" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallLicenseLinkText)</Hypertext>
    <Text X="11" Y="-11" Width="246" Height="17" FontId="3" DisablePrefix="yes">#(loc.InstallVersion)</Text>
    <Hypertext Name="UpgradeHyperlink" X="11" Y="-73" Width="-11" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallUpgradeLinkText)</Hypertext>
    <Checkbox Name="EulaAcceptCheckbox" X="-11" Y="-41" Width="246" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>
    <Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.InstallOptionsButton)</Button>
    <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
    <Button Name="WelcomeCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallCloseButton)</Button>
Aug 8, 2013 at 4:19 PM
Got it to work :) just looked at your examples :)

BTW depending on which application I install via the Radiobuttons, is there a way to set a variable for the license file?
radiobutton1 and 2 use the same EULA but radiobutton3 uses a different one, is there a way to change which license file to use via which radio button has been selected?

thanks,

Steve
Coordinator
Aug 11, 2013 at 9:20 AM
Sorry I didn't reply earlier but glad you got it working.

I can't think of a way to change the agreement with the standard code, you might be able to re-write it to pick up something different in the OnClickEulaLink() function.
Aug 11, 2013 at 4:38 PM

Any idea when 3.8 is going to be released?

You said they are including your extended BA but not the custom action BAFunction?

I might try this suggestion

I just started working with the

WixExtendedBootstrapperApplication.HyperlinkLicense yesterday, and there is some functionality that I do not understand yet. But it seems like you could use the BAFunction.dll template.

In the bundle you would do something like:

"

<Variable Name='EULA1' Type='string' Value='<url to eula1>'

bal:Overridable='yes'/>

<Variable Name='EULA2' Type='string' Value='<url to eula2>'

bal:Overridable='yes'/>

"

In the BAFunction OnPlan, do something like this:

LPWSTR sczEula1 = NULL;

LPWSTR sczEula2 = NULL;

BalGetStringVariable(L"WixBundleName", &sczEula1);

BalExitOnFailure(hr, "Failed to get variable.");

BalGetStringVariable(L"WixBundleName", &sczEula2);

BalExitOnFailure(hr, "Failed to get variable.");

LONGLONG llValue = 0;

if (SUCCEEDED(BalGetNumericVariable(L"RadioButton1", &llValue)) &&

llValue)

{

m_pEngine->SetVariableNumeric(L"RadioButton", 1);

BalExitOnFailure(hr, "Failed to set variable.");

hr = m_pEngine->SetVariableString(L"WixExtbaLicenseUrl",

sczEula1);

BalExitOnFailure(hr, "Failed to set variable.");

}

else if (SUCCEEDED(BalGetNumericVariable(L"RadioButton2", &llValue)) && llValue)

{

m_pEngine->SetVariableNumeric(L"RadioButton", 2);

BalExitOnFailure(hr, "Failed to set variable.");

hr = m_pEngine->SetVariableString(L"WixExtbaLicenseUrl",

sczEula1);

BalExitOnFailure(hr, "Failed to set variable.");

}

else if (SUCCEEDED(BalGetNumericVariable(L"RadioButton3", &llValue)) && llValue)

{

m_pEngine->SetVariableNumeric(L"RadioButton", 3);

BalExitOnFailure(hr, "Failed to set variable.");

hr = m_pEngine->SetVariableString(L"WixExtbaLicenseUrl",

sczEula2);

BalExitOnFailure(hr, "Failed to set variable.");

}

else

{

m_pEngine->SetVariableNumeric(L"RadioButton", 0);

BalExitOnFailure(hr, "Failed to set variable.");

hr = m_pEngine->SetVariableString(L"WixExtbaLicenseUrl",

sczEula1);

BalExitOnFailure(hr, "Failed to set variable.");

}

ReleaseNullStr(sczEula1); // Release string so it can be re-used

ReleaseNullStr(sczEula2); // Release string so it can be re-used "

I am guessing that you might need to do something to reload the dialog, which I don't know what is involved there. I have setting the vars and reading them in the BAFuntion and changing them working, but I am not trying to do anything with the Eula string at this time so I am not sure of the dialog behavior in that regard. (For some reason I can't get the DelayStart to actually show and delay the splashcreen, but that will need to be another

thread.)

Phill

Coordinator
Aug 12, 2013 at 6:49 PM
No idea when 3.8 is going to be release.

BAFunctions are part of 3.8.
Aug 12, 2013 at 6:54 PM

Sweet so your whole extended BA is going in that is awesome J