提交 8e4dcd53 编写于 作者: N NickMRamirez 提交者: Alexis Campailla

Added a dialog to the installer that lets the user customize the port and...

Added a dialog to the installer that lets the user customize the port and firewall exception. The port will update the config file via a new WiX Custom action project.
上级 a38bbe72
......@@ -42,7 +42,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReleasePackagingTool", "Rel
{A65C2CD6-72A3-441A-AEA3-D754BEA9A86A} = {A65C2CD6-72A3-441A-AEA3-D754BEA9A86A}
EndProjectSection
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "RedisWindowsX64", "RedisWindowsX64\RedisWindowsX64.wixproj", "{C829D256-16B4-4DC7-9BF9-6814F76B441E}"
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "RedisWindowsX64", "msi\RedisWindowsX64\RedisWindowsX64.wixproj", "{C829D256-16B4-4DC7-9BF9-6814F76B441E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedisWindowsX64.CustomActions", "msi\RedisWindowsX64.CustomActions\RedisWindowsX64.CustomActions.csproj", "{A917027E-D229-46C9-B969-1F4CE7D5D2CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -199,15 +201,29 @@ Global
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Debug|Win32.ActiveCfg = Debug|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Debug|Win32.Build.0 = Debug|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Debug|x64.ActiveCfg = Debug|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Debug|x64.Build.0 = Debug|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Debug|x86.ActiveCfg = Debug|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Debug|x86.Build.0 = Debug|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Release|Mixed Platforms.ActiveCfg = Release|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Release|Mixed Platforms.Build.0 = Release|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Release|Win32.ActiveCfg = Release|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Release|Win32.Build.0 = Release|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Release|x64.ActiveCfg = Release|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Release|x64.Build.0 = Release|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Release|x86.ActiveCfg = Release|x86
{C829D256-16B4-4DC7-9BF9-6814F76B441E}.Release|x86.Build.0 = Release|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Debug|Mixed Platforms.Build.0 = Debug|x64
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Debug|Win32.ActiveCfg = Debug|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Debug|Win32.Build.0 = Debug|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Debug|x64.ActiveCfg = Debug|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Debug|x86.ActiveCfg = Debug|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Debug|x86.Build.0 = Debug|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Release|Mixed Platforms.ActiveCfg = Release|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Release|Mixed Platforms.Build.0 = Release|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Release|Win32.ActiveCfg = Release|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Release|Win32.Build.0 = Release|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Release|x64.ActiveCfg = Release|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Release|x86.ActiveCfg = Release|x86
{A917027E-D229-46C9-B969-1F4CE7D5D2CA}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:fw="http://schemas.microsoft.com/wix/FirewallExtension">
<Fragment>
<PropertyRef Id="WIX_ACCOUNT_NETWORKSERVICE" />
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="cmp_redis_benchmarkEXE" Guid="*">
<File Source="$(var.RedisBenchmark.TargetDir)redis-benchmark.exe" />
</Component>
<Component Id="cmp_redis_check_aofEXE" Guid="*">
<File Source="$(var.RedisCheckAof.TargetDir)redis-check-aof.exe" />
</Component>
<Component Id="cmp_redis_check_dumpEXE" Guid="*">
<File Source="$(var.RedisCheckDump.TargetDir)redis-check-dump.exe" />
</Component>
<Component Id="cmp_redis_cliEXE" Guid="*">
<File Source="$(var.RedisCli.TargetDir)redis-cli.exe" />
</Component>
<!--
The following component installs Redis as a Windows service.
-->
<Component Id="cmp_redis_server" Guid="*">
<File Id="file_redis_server" Source="$(var.RedisServer.TargetDir)redis-server.exe" />
<ServiceInstall Id="redisService" Name="Redis" DisplayName="Redis" Description="This service runs the Redis server" Start="auto" ErrorControl="normal" Type="ownProcess" Arguments="--service-run &quot;[#file_redis.windowsCONF]&quot; --loglevel [LOGLEVEL]" Account="[WIX_ACCOUNT_NETWORKSERVICE]" />
<ServiceControl Id="redisServiceControl" Name="Redis" Start="install" Stop="both" Remove="uninstall" Wait="yes" />
<fw:FirewallException Id="fw_redis_server" Program="[#file_redis_server]" Description="Exception for Redis server" Name="Redis" Scope="any" />
</Component>
<!--
The following component gives the NetworkService user full access to the Redis install directory.
It needs this to start the service.
-->
<Component Id="cmp_give_network_service_folder_permissions" Guid="{55E5EFB3-61E6-4D51-934E-BFEEFB430701}">
<CreateFolder>
<util:PermissionEx User="[WIX_ACCOUNT_NETWORKSERVICE]" GenericAll="yes" />
</CreateFolder>
</Component>
</ComponentGroup>
<!--Documentation files-->
<ComponentGroup Id="DocumentationComponents" Directory="INSTALLFOLDER" Source="..\setups\documentation">
<Component Id="cmp_Redis_on_Windows_Release_NotesDOCX" Guid="*">
<File Name="Redis on Windows Release Notes.docx" />
</Component>
<Component Id="cmp_Redis_on_WindowsDOCX" Guid="*">
<File Name="Redis on Windows.docx" />
</Component>
<Component Id="cmp_redis.windowsCONF" Guid="*">
<File Id="file_redis.windowsCONF" Name="redis.windows.conf" />
</Component>
<Component Id="cmp_Windows_Service_DocumentationDOCX" Guid="*">
<File Name="Windows Service Documentation.docx" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
\ No newline at end of file
<?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>
using System;
using System.IO;
using Microsoft.Deployment.WindowsInstaller;
namespace RedisWindowsX64.CustomActions
{
/// <summary>
/// Defines actions to take during the MSI install that don't
/// come standard with WiX.
/// </summary>
public class CustomActions
{
/// <summary>
/// Overwrites settings in the Redis config file using values from the installer.
/// </summary>
/// <param name="session">The install session context</param>
/// <returns>Returns Success when the method completes. Exceptions will bubble up and
/// cause the installer to roll back.</returns>
[CustomAction]
public static ActionResult UpdateRedisConfig(Session session)
{
// Update port
string port = session.CustomActionData["PORT"];
string configFilePath = session.CustomActionData["CONFIG_PATH"];
UpdatePortSetting(port, configFilePath);
return ActionResult.Success;
}
/// <summary>
/// Updates the port in the config file.
/// </summary>
/// <param name="portToUse">The port to have Redis listen at</param>
/// <param name="configFilePath">The path to the Redis config file</param>
private static void UpdatePortSetting(string portToUse, string configFilePath)
{
if (File.Exists(configFilePath))
{
string originalContent = File.ReadAllText(configFilePath);
string updatedContent = originalContent.Replace("port 6379", "port " + portToUse);
File.WriteAllText(configFilePath, updatedContent);
}
else
{
throw new ApplicationException("UpdateRedisConfig: Config file not found. Could not update its settings.");
}
}
}
}
using System.Reflection;
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("RedisWindowsX64.CustomActions")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("MSOpenTech")]
[assembly: AssemblyProduct("RedisWindowsX64.CustomActions")]
[assembly: AssemblyCopyright("Copyright © MSOpenTech 2015")]
[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("afda0233-dacd-4bbe-89ce-19cdb9000561")]
// 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")]
<?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>{A917027E-D229-46C9-B969-1F4CE7D5D2CA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RedisWindowsX64.CustomActions</RootNamespace>
<AssemblyName>RedisWindowsX64.CustomActions</AssemblyName>
<TargetFrameworkVersion>v2.0</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>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<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>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<!--Documentation files to install-->
<ComponentGroup Id="DocumentationComponents" Directory="INSTALLFOLDER" Source="!(wix.DocumentationFolder)">
<Component Id="cmp_Redis_on_Windows_Release_NotesDOCX" Guid="*">
<File Name="Redis on Windows Release Notes.docx" />
</Component>
<Component Id="cmp_Redis_on_WindowsDOCX" Guid="*">
<File Name="Redis on Windows.docx" />
</Component>
<Component Id="cmp_Windows_Service_DocumentationDOCX" Guid="*">
<File Name="Windows Service Documentation.docx" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<!--Files to install, other than the main executable-->
<ComponentGroup Id="FileComponents" Directory="INSTALLFOLDER">
<Component Id="cmp_redis_benchmarkEXE" Guid="*">
<File Source="$(var.RedisBenchmark.TargetDir)redis-benchmark.exe" />
</Component>
<Component Id="cmp_redis_check_aofEXE" Guid="*">
<File Source="$(var.RedisCheckAof.TargetDir)redis-check-aof.exe" />
</Component>
<Component Id="cmp_redis_check_dumpEXE" Guid="*">
<File Source="$(var.RedisCheckDump.TargetDir)redis-check-dump.exe" />
</Component>
<Component Id="cmp_redis_cliEXE" Guid="*">
<File Source="$(var.RedisCli.TargetDir)redis-cli.exe" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:fw="http://schemas.microsoft.com/wix/FirewallExtension">
<Fragment>
<!--This references a WiX property that gives us the localized name of the NETWORK SERVICE user-->
<PropertyRef Id="WIX_ACCOUNT_NETWORKSERVICE" />
<ComponentGroup Id="WindowsServiceComponents" Directory="INSTALLFOLDER">
<!--
The following component installs Redis as a Windows service.
-->
<Component Id="cmp_redis_server" Guid="{959AF3FA-9324-49CB-8915-0563398CDDF6}">
<File Id="file_redis_serverEXE" Source="$(var.RedisServer.TargetDir)redis-server.exe" KeyPath="yes" />
<File Id="file_redis_windowsCONF" Source="!(wix.DocumentationFolder)\redis.windows.conf" />
<ServiceInstall Id="redisService"
Name="Redis"
DisplayName="Redis"
Description="This service runs the Redis server"
Start="auto"
ErrorControl="normal"
Type="ownProcess"
Arguments="--service-run &quot;[#file_redis_windowsCONF]&quot;"
Account="[WIX_ACCOUNT_NETWORKSERVICE]" />
<ServiceControl Id="redisServiceControl"
Name="Redis"
Start="install"
Stop="both"
Remove="uninstall"
Wait="yes" />
</Component>
<!--
The following component creates the firewall exception.
-->
<Component Id="cmp_firewall_exception" Guid="{1D39F01C-6C53-4DC1-B189-65F03F7E5E31}" KeyPath="yes">
<Condition><![CDATA[FIREWALL_ON = 1]]></Condition>
<fw:FirewallException Id="fw_redis_server"
Program="[#file_redis_serverEXE]"
Description="Exception for Redis server"
Name="Redis"
Scope="any" />
</Component>
<!--
The following component gives the NetworkService user full access to the Redis install directory.
It needs this to start the service.
-->
<Component Id="cmp_give_network_service_folder_permissions" Guid="{55E5EFB3-61E6-4D51-934E-BFEEFB430701}">
<CreateFolder>
<util:PermissionEx User="[WIX_ACCOUNT_NETWORKSERVICE]" GenericAll="yes" />
</CreateFolder>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
<copyright file="WixUI_InstallDir.wxs" company="Outercurve Foundation">
Copyright (c) 2004, Outercurve Foundation.
This software is released under Microsoft Reciprocal License (MS-RL).
The license and further copyright text can be found in the file
LICENSE.TXT at the root directory of the distribution.
</copyright>
-->
<!--
First-time install dialog sequence:
- WixUI_WelcomeDlg
- WixUI_LicenseAgreementDlg
- WixUI_InstallDirDlg
- FirwallDlg
- WixUI_VerifyReadyDlg
- WixUI_DiskCostDlg
Maintenance dialog sequence:
- WixUI_MaintenanceWelcomeDlg
- WixUI_MaintenanceTypeDlg
- WixUI_InstallDirDlg
- WixUI_VerifyReadyDlg
Patch dialog sequence:
- WixUI_WelcomeDlg
- WixUI_VerifyReadyDlg
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="CustomInstallDir">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />
<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<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="InstallDirDlg">LicenseAccepted = "1"</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="FirewallDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="FirewallDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1">1</Publish>
<Publish Dialog="FirewallDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="1">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="FirewallDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="FirewallDlg" Width="370" Height="270" Title="[ProductName] Setup">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Select whether to add an exception to the Windows Firewall for Redis." />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Firewall Exception" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="PortLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="Port to run Redis on:" />
<Control Id="PortEdit" Type="Edit" Property="PORT" Height="17" Width="50" X="20" Y="100" />
<Control Id="FirewallCheckbox" Type="CheckBox" Property="FIREWALL_ON" CheckBoxValue="1" Integer="yes" Text="Add an exception to the Windows Firewall" Height="10" Width="200" X="20" Y="140" />
</Dialog>
</UI>
</Fragment>
</Wix>
\ No newline at end of file
......@@ -6,30 +6,64 @@
32-bit installer
Example installation (command-line):
msiexec /i Redis-Windows-x64.msi LOGLEVEL=verbose
default install:
msiexec /i Redis-Windows-x64.msi
set port and turn on firewall exception:
msiexec /i Redis-Windows-x64.msi PORT=1234 FIREWALL_ON=""
set port and turn off firewall exception:
msiexec /i Redis-Windows-x64.msi PORT=1234 FIREWALL_ON=1
-->
<Product Id="*" Name="Redis on Windows" Language="1033" Version="1.0.0.0" Manufacturer="MSOpenTech" UpgradeCode="{05410198-7212-4FC4-B7C8-AFEFC3DA0FBC}">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Product Id="*"
Name="Redis on Windows"
Language="1033"
Version="1.0.0.0"
Manufacturer="MSOpenTech"
UpgradeCode="{05410198-7212-4FC4-B7C8-AFEFC3DA0FBC}">
<Package InstallerVersion="200"
Compressed="yes"
InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Property Id="ARPURLINFOABOUT" Value="https://github.com/MSOpenTech/redis" />
<Property Id="LOGLEVEL" Value="verbose" />
<UIRef Id="WixUI_InstallDir"/>
<!--User interface hook-->
<UIRef Id="CustomInstallDir"/>
<!--Custom actions-->
<Binary Id="RedisCustomActionsDLL" SourceFile="$(var.RedisWindowsX64.CustomActions.TargetDir)RedisWindowsX64.CustomActions.CA.dll" />
<CustomAction Id="ca_UpdateRedisConfig" BinaryKey="RedisCustomActionsDLL" DllEntry="UpdateRedisConfig" Execute="deferred" Return="check" />
<SetProperty Id="ca_UpdateRedisConfig" Value="CONFIG_PATH=[#file_redis_windowsCONF];PORT=[PORT]" Sequence="execute" Before="ca_UpdateRedisConfig" />
<InstallExecuteSequence>
<Custom Action="ca_UpdateRedisConfig" After="InstallFiles"><![CDATA[NOT Installed]]></Custom>
</InstallExecuteSequence>
<!--Properties-->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<Property Id="ARPURLINFOABOUT" Value="https://github.com/MSOpenTech/redis" />
<Property Id="PORT" Value="6379" />
<Property Id="FIREWALL_ON" Value="1" />
<!--Link-time variables-->
<WixVariable Id="WixUILicenseRtf" Value="License.rtf"/>
<WixVariable Id="WixUIDialogBmp" Value="redis_background.jpg"/>
<WixVariable Id="WixUIBannerBmp" Value="top_banner.jpg"/>
<WixVariable Id="WixUIDialogBmp" Value="Images/redis_background.jpg"/>
<WixVariable Id="WixUIBannerBmp" Value="Images/top_banner.jpg"/>
<WixVariable Id="DocumentationFolder" Value="..\..\setups\documentation"/>
<!--Features-->
<Feature Id="ProductFeature" Title="Redis" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="FileComponents" />
<ComponentGroupRef Id="WindowsServiceComponents" />
<ComponentGroupRef Id="DocumentationComponents" />
</Feature>
</Product>
<Fragment>
<!--Directory structure to create-->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="Redis-Windows" />
......
......@@ -22,12 +22,27 @@
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>Debug</DefineConstants>
<CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<CompilerAdditionalOptions>-arch x64</CompilerAdditionalOptions>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="FileComponents.wxs" />
<Compile Include="Components\DocumentationComponents.wxs" />
<Compile Include="Components\FileComponents.wxs" />
<Compile Include="Components\WindowsServiceComponents.wxs" />
<Compile Include="Dialogs\CustomInstallDir.wxs" />
<Compile Include="Dialogs\FirewallDialog.wxs" />
<Compile Include="Product.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RedisBenchmark\RedisBenchmark.vcxproj">
<ProjectReference Include="..\..\RedisBenchmark\RedisBenchmark.vcxproj">
<Name>RedisBenchmark</Name>
<Project>{b00d4bb5-44de-405e-839c-d16f547006cf}</Project>
<Private>True</Private>
......@@ -35,7 +50,7 @@
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\RedisCheckAof\RedisCheckAof.vcxproj">
<ProjectReference Include="..\..\RedisCheckAof\RedisCheckAof.vcxproj">
<Name>RedisCheckAof</Name>
<Project>{a65c2cd6-72a3-441a-aea3-d754bea9a86a}</Project>
<Private>True</Private>
......@@ -43,7 +58,7 @@
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\RedisCheckDump\RedisCheckDump.vcxproj">
<ProjectReference Include="..\..\RedisCheckDump\RedisCheckDump.vcxproj">
<Name>RedisCheckDump</Name>
<Project>{52193a97-d010-41d6-bf2b-33e8e764e308}</Project>
<Private>True</Private>
......@@ -51,7 +66,7 @@
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\RedisCli\RedisCli.vcxproj">
<ProjectReference Include="..\..\RedisCli\RedisCli.vcxproj">
<Name>RedisCli</Name>
<Project>{392bbb91-3934-4a56-af42-65c5728311e8}</Project>
<Private>True</Private>
......@@ -59,7 +74,7 @@
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\RedisServer.vcxproj">
<ProjectReference Include="..\..\RedisServer.vcxproj">
<Name>RedisServer</Name>
<Project>{46842776-68a5-ec98-6a09-1859bbfc73aa}</Project>
<Private>True</Private>
......@@ -67,6 +82,14 @@
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\RedisWindowsX64.CustomActions\RedisWindowsX64.CustomActions.csproj">
<Name>RedisWindowsX64.CustomActions</Name>
<Project>{a917027e-d229-46c9-b969-1f4ce7d5d2ca}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUIExtension">
......@@ -83,9 +106,14 @@
</WixExtension>
</ItemGroup>
<ItemGroup>
<Content Include="Images\redis_background.jpg" />
<Content Include="Images\top_banner.jpg" />
<Content Include="License.rtf" />
<Content Include="redis_background.jpg" />
<Content Include="top_banner.jpg" />
</ItemGroup>
<ItemGroup>
<Folder Include="Images" />
<Folder Include="Dialogs" />
<Folder Include="Components" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<!--
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册