Skip to content

Commit

Permalink
Merge branch 'release/1.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernhard committed Mar 31, 2019
2 parents 0b17930 + e88dd55 commit 7a75b6b
Show file tree
Hide file tree
Showing 15 changed files with 508 additions and 106 deletions.
72 changes: 72 additions & 0 deletions CA_ReadConfig/CA_ReadConfig.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C01A4B05-BE4B-460F-9DF4-D431505721DF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CA_ReadConfig</RootNamespace>
<AssemblyName>CA_ReadConfig</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.Deployment.WindowsInstaller">
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CustomAction.cs" />
<Compile Include="IniFile.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="CustomAction.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(WixCATargetsPath)" Condition=" '$(WixCATargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.CA.targets" Condition=" '$(WixCATargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.CA.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixCATargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
</Project>
32 changes: 32 additions & 0 deletions CA_ReadConfig/CustomAction.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">

<!--
Use supportedRuntime tags to explicitly specify the version(s) of the .NET Framework runtime that
the custom action should run on. If no versions are specified, the chosen version of the runtime
will be the "best" match to what Microsoft.Deployment.WindowsInstaller.dll was built against.
WARNING: leaving the version unspecified is dangerous as it introduces a risk of compatibility
problems with future versions of the .NET Framework runtime. It is highly recommended that you specify
only the version(s) of the .NET Framework runtime that you have tested against.
Note for .NET Framework v3.0 and v3.5, the runtime version is still v2.0.
In order to enable .NET Framework version 2.0 runtime activation policy, which is to load all assemblies
by using the latest supported runtime, @useLegacyV2RuntimeActivationPolicy="true".
For more information, see http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx
-->

<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727"/>

</startup>

<!--
Add additional configuration settings here. For more information on application config files,
see http://msdn.microsoft.com/en-us/library/kza1yk3a.aspx
-->

</configuration>
35 changes: 35 additions & 0 deletions CA_ReadConfig/CustomAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Deployment.WindowsInstaller;

namespace CA_ReadConfig
{
public class CustomActions
{
[CustomAction]
public static ActionResult ReadHost(Session session)
{
var config = GetConfig(session["CONFIG_FILE"]);

session["SERVICE_HOST"] = config.IniReadValue("default", "host");

return ActionResult.Success;
}

[CustomAction]
public static ActionResult ReadPort(Session session)
{
var config = GetConfig(session["CONFIG_FILE"]);

session["SERVICE_PORT"] = config.IniReadValue("default", "port");

return ActionResult.Success;
}

private static INIFile GetConfig(string path)
{
return new INIFile(path);
}
}
}
32 changes: 32 additions & 0 deletions CA_ReadConfig/IniFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System.Text;
using System.Runtime.InteropServices;


namespace CA_ReadConfig
{
public class INIFile
{
public string path { get; private set; }

[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);

public INIFile(string INIPath)
{
path = INIPath;
}
public void IniWriteValue(string Section, string Key, string Value)
{
WritePrivateProfileString(Section, Key, Value, path);
}

public string IniReadValue(string Section, string Key)
{
StringBuilder temp = new StringBuilder(255);
int i = GetPrivateProfileString(Section, Key, "", temp, 255, path);
return temp.ToString();
}
}
}
35 changes: 35 additions & 0 deletions CA_ReadConfig/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CA_ReadConfig")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("Meusburger Georg GmbH")]
[assembly: AssemblyProduct("CA_ReadConfig")]
[assembly: AssemblyCopyright("Copyright © Meusburger Georg GmbH 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c01a4b05-be4b-460f-9df4-d431505721df")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
14 changes: 14 additions & 0 deletions TikaServiceInstaller.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 15.0.28010.2050
MinimumVisualStudioVersion = 10.0.40219.1
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "TikaServiceInstaller", "TikaServiceInstaller\TikaServiceInstaller.wixproj", "{63B23924-060F-4D4A-9B88-9457EA87662F}"
ProjectSection(ProjectDependencies) = postProject
{C01A4B05-BE4B-460F-9DF4-D431505721DF} = {C01A4B05-BE4B-460F-9DF4-D431505721DF}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2E4721ED-B1F4-44E8-95C7-8CBB056BD8FC}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -13,6 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CA_ReadConfig", "CA_ReadConfig\CA_ReadConfig.csproj", "{C01A4B05-BE4B-460F-9DF4-D431505721DF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -22,12 +27,21 @@ Global
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{63B23924-060F-4D4A-9B88-9457EA87662F}.Debug|x64.ActiveCfg = Debug|x64
{63B23924-060F-4D4A-9B88-9457EA87662F}.Debug|x64.Build.0 = Debug|x64
{63B23924-060F-4D4A-9B88-9457EA87662F}.Debug|x86.ActiveCfg = Debug|x86
{63B23924-060F-4D4A-9B88-9457EA87662F}.Debug|x86.Build.0 = Debug|x86
{63B23924-060F-4D4A-9B88-9457EA87662F}.Release|x64.ActiveCfg = Release|x64
{63B23924-060F-4D4A-9B88-9457EA87662F}.Release|x64.Build.0 = Release|x64
{63B23924-060F-4D4A-9B88-9457EA87662F}.Release|x86.ActiveCfg = Release|x86
{63B23924-060F-4D4A-9B88-9457EA87662F}.Release|x86.Build.0 = Release|x86
{C01A4B05-BE4B-460F-9DF4-D431505721DF}.Debug|x64.ActiveCfg = Debug|x64
{C01A4B05-BE4B-460F-9DF4-D431505721DF}.Debug|x64.Build.0 = Debug|x64
{C01A4B05-BE4B-460F-9DF4-D431505721DF}.Debug|x86.ActiveCfg = Debug|x86
{C01A4B05-BE4B-460F-9DF4-D431505721DF}.Debug|x86.Build.0 = Debug|x86
{C01A4B05-BE4B-460F-9DF4-D431505721DF}.Release|x64.ActiveCfg = Release|x64
{C01A4B05-BE4B-460F-9DF4-D431505721DF}.Release|x64.Build.0 = Release|x64
{C01A4B05-BE4B-460F-9DF4-D431505721DF}.Release|x86.ActiveCfg = Release|x86
{C01A4B05-BE4B-460F-9DF4-D431505721DF}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
16 changes: 16 additions & 0 deletions TikaServiceInstaller/Binaries.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<!-- use .dll which has a custom action to check if a JRE is installed -->
<Binary Id="CA_CheckJava" SourceFile="$(var.SolutionDir)/packages/CA_CheckJava.1.0.3/lib/net45/CA_CheckJava.CA.dll" />

<!-- dll which provides the functionality to open a dialog to choose a file -->
<Binary Id="CA_DirectoryChooser" SourceFile="$(var.SolutionDir)/packages/CA_DirectoryChooser.1.0.2/lib/net45/CA_DirectoryChooser.CA.dll" />

<!-- dll to make input validation -->
<Binary Id="CA_InputValidation" SourceFile="$(var.SolutionDir)/packages/CA_InputValidation.1.0.2/lib/net45/CA_InputValidation.CA.dll" />

<!-- CA_ReadConfig to read the host and port for upgrades (with IniFileSearch it's difficult to read the value from a dynamic path -->
<Binary Id="CA_ReadConfig" SourceFile="$(var.SolutionDir)/CA_ReadConfig/bin/$(var.Configuration)/CA_ReadConfig.CA.dll" />
</Fragment>
</Wix>
2 changes: 1 addition & 1 deletion TikaServiceInstaller/Dialogs/TikaServiceDlg.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Publish Event="SpawnDialog" Value="PortInUseWarningDlg" Order="3">NOT PORT_IS_AVAILABLE</Publish>
<Publish Property="CA_IV_SERVICE_NAME" Value="[SERVICE_NAME]" Order="4">1</Publish>
<Publish Event="DoAction" Value="CheckServiceName" Order="5">1</Publish>
<Publish Event="SpawnDialog" Value="ServiceExistsWarningDlg" Order="6">CA_IV_SERVICE_EXISTS</Publish>
<Publish Event="SpawnDialog" Value="ServiceExistsWarningDlg" Order="6">CA_IV_SERVICE_EXISTS AND NOT WIX_UPGRADE_DETECTED</Publish>
</Control>
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.AdvancedWelcomeEulaDlgBannerBitmap)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="300" Height="13" Transparent="yes" NoPrefix="yes" Text="!(loc.TikaServiceDlgTitle)" />
Expand Down
23 changes: 23 additions & 0 deletions TikaServiceInstaller/DirectoryStructure.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<?include PreProcessorVariables.wxi ?>

<Fragment>
<!-- ################### Directory structure ######################### -->
<!-- all predifined; directory in which the final programm will get installed-->
<Directory Id="TARGETDIR" Name="SourceDir">

<!-- Program Files folder for our bitness -->
<Directory Id="$(var.ProgramFilesFolder)">
<Directory Id="INSTALLFOLDER" Name="TikaService" />
</Directory>

<Directory Id="$(var.SystemFolder)">
<Directory Id="LogFiles" Name="LogFiles">
<Directory Id="LOG_PATH" Name="TikaService" />
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
27 changes: 14 additions & 13 deletions TikaServiceInstaller/InstallerUI.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,27 @@ Patch dialog sequence:
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>

<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="1">LicenseAccepted = "1" AND WIX_UPGRADE_DETECTED</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="TikaServiceDlg" Order="2">LicenseAccepted = "1" AND NOT WIX_UPGRADE_DETECTED</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomInstallDirDlg" Order="2">LicenseAccepted = "1"</Publish>

<Publish Dialog="TikaServiceDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="1">1</Publish>
<Publish Dialog="TikaServiceDlg" Control="Next" Event="NewDialog" Value="CustomInstallDirDlg" Order="7"><![CDATA[NOT CA_IV_SERVICE_EXISTS AND PORT_IS_AVAILABLE]]></Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="NewDialog" Value="TikaServiceDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Property="CONFIG_FILE" Value="[INSTALLFOLDER]/config/service.config" Order="5">1</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="DoAction" Value="ReadHost" Order="6">1</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="DoAction" Value="ReadPort" Order="6">1</Publish>

<Publish Dialog="TikaServiceDlg" Control="Back" Event="NewDialog" Value="CustomInstallDirDlg" Order="1">1</Publish>
<Publish Dialog="TikaServiceDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="7"><![CDATA[NOT CA_IV_SERVICE_EXISTS AND PORT_IS_AVAILABLE OR WIX_UPGRADE_DETECTED]]></Publish>

<!-- warning that the servicename is already taken -->
<Publish Dialog="ServiceExistsWarningDlg" Control="Back" Event="EndDialog" Value="Return">1</Publish>

<!-- warning that the port is already in use -->
<Publish Dialog="PortInUseWarningDlg" Control="Back" Event="EndDialog" Value="Return">1</Publish>

<Publish Dialog="CustomInstallDirDlg" Control="Back" Event="NewDialog" Value="TikaServiceDlg">1</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>

<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomInstallDirDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="2">WIX_UPGRADE_DETECTED</Publish>

<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="TikaServiceDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="3">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="4">Installed AND PATCH</Publish>

Expand Down
20 changes: 20 additions & 0 deletions TikaServiceInstaller/PreProcessorVariables.wxi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Include>

<?define Manufacturer = Meusburger Guntram GmbH ?>
<?define ProductName = "TikaService $(var.BuildVersionExact) ($(var.Platform))"?>

<!-- platform specifics -->
<?if $(var.Platform) = x64 ?>
<?define IsWin64 = "yes" ?>
<?define ProgramFilesFolder = ProgramFiles64Folder ?>
<?define SystemFolder = System64Folder?>
<?define WixQuietExec = WixQuietExec64 ?>
<?else?>
<?define IsWin64 = "no" ?>
<?define ProgramFilesFolder = ProgramFilesFolder ?>
<?define SystemFolder = SystemFolder ?>
<?define WixQuietExec = WixQuietExec ?>
<?endif?>

</Include>
Loading

0 comments on commit 7a75b6b

Please sign in to comment.