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

#420: Windows installer draft pr (Wix toolset) #813

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7af9fc5
#765: Fix typos in DoD asciidoc
Oct 2, 2024
aeae1dd
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 17, 2024
e520d16
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 25, 2024
29403d3
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 25, 2024
5bff5eb
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 28, 2024
890c107
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 29, 2024
c55af62
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Oct 31, 2024
5224bf9
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 7, 2024
d925977
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 8, 2024
4a8f60b
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 12, 2024
1a6cdb8
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 13, 2024
f79c030
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 14, 2024
3d2b190
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 14, 2024
e1854bb
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 15, 2024
0302acf
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 19, 2024
1410aaa
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 21, 2024
0ab3f49
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 22, 2024
bb75cf9
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 22, 2024
3668654
Merge branch 'main' of https://github.com/KianRolf/IDEasy
KianRolf Nov 27, 2024
e77f25b
#420: windows installer created with wix toolset
KianRolf Nov 27, 2024
e635322
Merge branch 'main' into implement/windows-installer
jan-vcapgemini Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions WindowsInstaller/Tutorial/CustomAction/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>
46 changes: 46 additions & 0 deletions WindowsInstaller/Tutorial/CustomAction/CustomAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using Microsoft.Deployment.WindowsInstaller;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace CustomAction
{
public class CustomActions
{
[CustomAction]
public static ActionResult CheckDataDrive(Session session)
{
ActionResult retVal;

session.Log("Begin CheckDataDrive");
if (TrySetTargetDir("D", session))
{
retVal = ActionResult.Success;
}
else if (TrySetTargetDir("C", session))
{
retVal = ActionResult.Success;
}
else
{
retVal = ActionResult.Failure;
}
session.Log("End CheckDataDrive");

return retVal;
}

private static bool TrySetTargetDir(string driveLetter, Session session)
{
var driveInfo = new DriveInfo(driveLetter);
if (driveInfo.DriveType != DriveType.Fixed || !driveInfo.IsReady)
return false;

// Set the INSTALLFOLDER
session["INSTALLFOLDER"] = $@"{driveLetter}:\Configurations";
session.Log($"INSTALLFOLDER changed to {session["INSTALLFOLDER"]}");
return true;
}
}
}
54 changes: 54 additions & 0 deletions WindowsInstaller/Tutorial/CustomAction/CustomAction.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?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>{968E6209-7731-4E67-9925-D7EA7EED68C9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CustomAction</RootNamespace>
<AssemblyName>CustomAction</AssemblyName>
<TargetFrameworkVersion>v4.7.2</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>
<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="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 build tools must be installed to build this project. To download the WiX Toolset, see https://wixtoolset.org/releases/v3.11/stable" />
</Target>
</Project>
35 changes: 35 additions & 0 deletions WindowsInstaller/Tutorial/CustomAction/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("CustomAction")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("Capgemini")]
[assembly: AssemblyProduct("CustomAction")]
[assembly: AssemblyCopyright("Copyright © Capgemini 2024")]
[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("968e6209-7731-4e67-9925-d7ea7eed68c9")]

// 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")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading