build: new windows installer
Created new windows installer based on the WiX Toolset
This commit is contained in:
+32
@@ -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>
|
||||
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.Deployment.WindowsInstaller;
|
||||
using System.Xml;
|
||||
|
||||
namespace SetupAppSettings
|
||||
{
|
||||
public class CustomActions
|
||||
{
|
||||
[CustomAction]
|
||||
public static ActionResult Main(Session session)
|
||||
{
|
||||
session.Log("Removing log folder");
|
||||
|
||||
try
|
||||
{
|
||||
RemoveLogFolder();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
session.Log("Failed to remove log folder.");
|
||||
session.Log("Exception: " + e.ToString());
|
||||
return ActionResult.NotExecuted;
|
||||
}
|
||||
|
||||
session.Log("Log folder removed");
|
||||
|
||||
return ActionResult.Success;
|
||||
}
|
||||
|
||||
private static void RemoveLogFolder()
|
||||
{
|
||||
// remove logs
|
||||
string path = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software\\Coati\\log";
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
Directory.Delete(path, true);
|
||||
}
|
||||
|
||||
// remove sample projects
|
||||
path = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software\\Coati\\projects\\tutorial";
|
||||
if(Directory.Exists(path))
|
||||
{
|
||||
Directory.Delete(path, true);
|
||||
}
|
||||
|
||||
path = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software\\Coati\\projects\\tictactoe";
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
Directory.Delete(path, true);
|
||||
}
|
||||
|
||||
// remove projects folder if empty (avoid deleting user generated files)
|
||||
path = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software\\Coati\\projects";
|
||||
if (Directory.Exists(path) && !Directory.EnumerateFileSystemEntries(path).Any())
|
||||
{
|
||||
Directory.Delete(path, true);
|
||||
}
|
||||
|
||||
// remove coati folder if empty (may not be empty if user stored stuff in here)
|
||||
path = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software\\Coati";
|
||||
if (Directory.Exists(path) && !Directory.EnumerateFileSystemEntries(path).Any())
|
||||
{
|
||||
Directory.Delete(path, true);
|
||||
}
|
||||
|
||||
path = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software";
|
||||
if (Directory.Exists(path) && !Directory.EnumerateFileSystemEntries(path).Any())
|
||||
{
|
||||
Directory.Delete(path, true);
|
||||
}
|
||||
|
||||
//string coatiPath = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software";
|
||||
|
||||
//Directory.Delete(coatiPath, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+35
@@ -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("UninstallRemoveLogFolder")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("UninstallRemoveLogFolder")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[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("7b853830-9077-4803-8adf-12d7b2886958")]
|
||||
|
||||
// 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")]
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" 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>{7B853830-9077-4803-8ADF-12D7B2886958}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>UninstallRemoveLogFolder</RootNamespace>
|
||||
<AssemblyName>UninstallRemoveLogFolder</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<WixCATargetsPath Condition=" '$(WixCATargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.CA.targets</WixCATargetsPath>
|
||||
</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>..\..\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</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)" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user