Skip to content
This repository was archived by the owner on Feb 20, 2021. It is now read-only.

Conversation

@NickMRamirez
Copy link

Adds 64-bit and 32-bit MSI installers.

Installers do the following:

  • Adds entry to Program and Features
  • Can be installed from the command line: msiexec /i Redis-Windows-x64.msi
  • Can be installed by double-clicking MSI
  • Creates a Windows service for Redis that runs as NetworkService
  • Adds an exception to the Windows firewall for Redis service
  • Copies Redis executables and documentation to Program Files

Outstanding issues:

WiX binaries are included here in the source. Further discussion needed about why this might not be desired. Submitting it this way for now so as not to hold anybody up on accepting this pull request if binaries in the source are okay.

@ghost
Copy link

ghost commented Jan 18, 2015

Hi @NickMRamirez, I'm your friendly neighborhood Microsoft Open Technologies, Inc. Pull Request Bot (You can call me MSOTBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla2.msopentech.com.

TTYL, MSOTBOT;

@ghost ghost added the cla-required label Jan 18, 2015
@ghost
Copy link

ghost commented Jan 18, 2015

@NickMRamirez, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, MSOTBOT;

@orangemocha
Copy link

Thank you @NickMRamirez for contributing this pull request!

A WiX installer would certainly be a useful addition. I reviewed the proposed changes and I think that - while this in the right direction - there are some issues that would need to be addressed before we can accept this contribution:

  1. The 32-bit part should be removed (both the redis 32-bit project and the installer). With version 2.8.9 we dropped support for 32-bit (so that we could focus our limited resources on the most common usage scenario). It’s possible that we will decide to bring 32-bit back at some point, but that will require more testing and should be done outside of the context of this PR.
  2. The installer currently doesn’t have any UI dialogs that would help the user control the process (or give feedback). At a minimum, it would need the following dialogs:
    a. A way to accept a license agreement
    b. A way to customize the installation folder
    c. A way (checkbox) to control the firewall exception. Currently the user is not informed that this happening and it might open some security risks to do it silently.
    d. Confirmation of completion/success at the end
  3. As you pointed out, including the WiX binaries in the source tree is not the most desirable option. A better option would be to list this as a pre-requisite in the readme. (In an ideal world, we would have a script to check for installed pre-requisites and download them, but this is probably overkill now as our list of prerequisites is very small).
  4. I am not convinced that installing Redis as a service with the default/sample configuration will make the user’s life easier, if then the user needs to go stop the service, edit the configuration file, and start the service in order to enable any useful scenarios and/or avoid port conflicts. Can we think of a better way to do this? At best, this should be an optional step.
  5. When I tested this on my machine, the installation folder did not get removed after uninstalling.

Thanks,
Alexis (MS Open Tech)

@NickMRamirez
Copy link
Author

I'll update it soon, possibly this weekend. For #4, which config settings can we default and which should the installer ask for? I think it's better to at least default some things. What settings would a user most likely change when they first install? For #5, can you give more information about the steps you took to install (OS, for example)?

@orangemocha
Copy link

Thanks @NickMRamirez !

I suppose that for service default settings, the redis.windows.conf that comes as a sample is a good starting point. I am wondering if there are any settings specific to running as a service that would justify creating a separate redis.service.conf. The only one I can think of is logfile (for a service, we don't want to log to stdout, but rather to a file in the same directory). But your installer already overrides the logfile option, correct?

For #5, I just ran the installer on Windows 8.1 64-bit, then uninstalled from "Programs & Features".

@orangemocha
Copy link

Adding a minor suggestion:
6. Currently the wix project redises under RedisWindowsX64, which is not very explanatory. I would put that under a "msi" directory.

… and firewall exception. The port will update the config file via a new WiX Custom action project.
@NickMRamirez
Copy link
Author

I have made the following changes to the WiX setup:

  • Moved in a folder called "msi"
  • Added a user-interface that lets the user accept the EULA, set the install directory, update the port and opt out of the firewall exception
  • Added a new WiX custom action project that's used by the installer to update the redis.windows.conf file with the port that the user set in the installer
  • Updated the Word doc in the install folder to explain how the MSI setup works
  • Removed the x64 MSI
  • Removed the WiX binaries

Tested on:

  • Windows 8.1 x64
  • Windows 7 x64
  • Windows Server 2012 R2 x64
    --> install via the UI and via command-line worked, as well as uninstall. Note that the install folder will not be removed if you have a file open that's in that folder, such as might happen if you have a command prompt open to the CLI tool.

Changes I did not make (since I didn't know the best way to do it):

  • Update the README to explain where to get the MSI and how to use it in a silent install
  • Update the README about the WiX binaries dependency (WiX can be downloaded form wixtoolset.org)

Command-line usage:

default install (port 6379 and firewall exception ON):
msiexec /i Redis-Windows-x64.msi
set port and turn OFF firewall exception:
msiexec /i Redis-Windows-x64.msi PORT=1234 FIREWALL_ON=""
set port and turn ON firewall exception:
msiexec /i Redis-Windows-x64.msi PORT=1234 FIREWALL_ON=1
install with no user interface:
msiexec /quiet /i Redis-Windows-x64.msi

@NickMRamirez
Copy link
Author

Forgot to mention, about the logfile, if it's a good default, would it make sense to default it in the redis.windows.conf file? Not programmatically by the MSI?

@orangemocha
Copy link

Forgot to mention, about the logfile, if it's a good default, would it make sense to default it in the redis.windows.conf file? Not programmatically by the MSI?

redis.windows.conf is a port of the sample redis.conf that ships with antirez\redis. I feel it would be best to keep it in line with redis.conf as much as possible, while adding documentation for windows-specific config options.

So if such redis.windows.conf doesn't fit the usage scenario of a service installation, I would rather add a redis.service.conf for that purpose.

…iewer. This required that we also log to a file with the logfile setting, otherwise messages are not written to the event viewer...probably a mishandling of Windows OS. The event viewer requires a messages resource in the form of a DLL, so I updated the Win32_Interop project to have a custom build step to compile EventLog.res into EventLog.dll. Updated the WiX project to create the Windows event source and also the directory where the event log file will be written.
@NickMRamirez
Copy link
Author

Added service config file

orangemocha added a commit that referenced this pull request May 4, 2015
Add MSI installer. This is taken from #210, with a few more tweaks.
@orangemocha
Copy link

Landed in 199eb9f, with a few additional tweaks.

Thank you, @NickMRamirez, great work !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants