Fix 32-bit build
This commit is contained in:
@@ -1,34 +1,34 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.Deployment.WindowsInstaller;
|
||||
using System.ServiceProcess;
|
||||
|
||||
namespace RedisMsi.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;
|
||||
}
|
||||
|
||||
using System.ServiceProcess;
|
||||
|
||||
namespace RedisMsi.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>
|
||||
/// Sets a WiX property to indicate whether the Windows Firewall service is stopped.
|
||||
/// If the firewall service is stopped, the install will not succeed if it attempts
|
||||
@@ -36,7 +36,7 @@ namespace RedisMsi.CustomActions
|
||||
/// firewall to off does not pose a problem.
|
||||
/// </summary>
|
||||
/// <param name="session"></param>
|
||||
/// <returns></returns>
|
||||
/// <returns></returns>
|
||||
[CustomAction]
|
||||
public static ActionResult CheckIfFirewallServiceRunning(Session session)
|
||||
{
|
||||
@@ -49,25 +49,25 @@ namespace RedisMsi.CustomActions
|
||||
}
|
||||
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,8 +174,7 @@ link.exe -dll -noentry resources/EventLog.res -out:$(TargetDir)EventLog.dll
|
||||
</Link>
|
||||
<Lib>
|
||||
<IgnoreSpecificDefaultLibraries>MSVCRT</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalDependencies>
|
||||
</AdditionalDependencies>
|
||||
<AdditionalDependencies>DbgHelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Lib>
|
||||
<CustomBuild>
|
||||
<Command>
|
||||
@@ -224,8 +223,7 @@ link.exe -dll -noentry resources/EventLog.res -out:$(TargetDir)EventLog.dll
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<Lib>
|
||||
<AdditionalDependencies>
|
||||
</AdditionalDependencies>
|
||||
<AdditionalDependencies>DbgHelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Lib>
|
||||
<CustomBuild>
|
||||
<Command>
|
||||
|
||||
@@ -72,7 +72,7 @@ void RequestSuspension() {
|
||||
if (!ResetEvent(g_hResumeFromSuspension)) {
|
||||
exit(GetLastError());
|
||||
}
|
||||
InterlockedOr(&g_SuspensionRequested, 1);
|
||||
_InterlockedOr(&g_SuspensionRequested, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ void ResumeFromSuspension() {
|
||||
// This is meant to be called from the main thread only.
|
||||
assert(g_SuspensionRequested && SuspensionCompleted());
|
||||
|
||||
InterlockedAnd(&g_SuspensionRequested, 0);
|
||||
_InterlockedAnd(&g_SuspensionRequested, 0);
|
||||
if (!SetEvent(g_hResumeFromSuspension)) {
|
||||
exit(GetLastError());
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ typedef double PORT_LONGDOUBLE;
|
||||
typedef __int64 PORT_LONG;
|
||||
typedef unsigned __int64 PORT_ULONG;
|
||||
#else
|
||||
typedef _W64 long ssize_t;
|
||||
typedef _W64 long PORT_LONG;
|
||||
typedef _W64 unsigned long PORT_ULONG;
|
||||
typedef long ssize_t;
|
||||
typedef long PORT_LONG;
|
||||
typedef unsigned long PORT_ULONG;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN64
|
||||
|
||||
Reference in New Issue
Block a user