Removing install project since we have NuGet and Chocolatey installs. Removing RedisWAInst since Azure fork will handle their own installation.

This commit is contained in:
jonathan pickett
2014-04-15 19:01:55 -07:00
parent 884dd54bbc
commit a7f2df706e
45 changed files with 0 additions and 19455 deletions
-86
View File
@@ -1,86 +0,0 @@
Deploying Redis to Windows Azure
================================
1. Prepare the ServiceConfiguration.cloud.cscfg, ServiceConfiguration.Local.cscfg and ServiceDefinition.csdef files for the Redis worker roles you want to deploy. The RedisWR\Samples folder has examples you can use as a starting point.
2. Prepare a redis.conf file with the common Redis configuration settings that you wish to deploy. The same redis.conf is used as a base for the master and slave roles. The port numbers are automatically appended to each deployed redis.conf instance based on the cscfg file settings.
3. From the bin folder, run the RedisInstWA command in a command Window running as an elevated Administrator. This application prepares the installation configuration and the files to deploy, and then uses Inst4WA to do the deployment.
4. Inst4WA may install Azure SDK components it needs to run. If prompted to allow the installation please accept.
5. When deploying to Azure, if a publishsettings file is not provided then the default browser is used to download a publishsettings file for your account. You will need to sign in with your Azure account credentials. If you see a prompt in your browser to open or save the downloaded file, choose to save it. If you already have a publishsettings file with your credentials, copy it to the same folder as the ServiceDefinition.csdef file and it will be used. Alternatively you can provide a full path on the command line using a pass-through parameter.
RedisInstWA command line
------------------------
RedisInstWA -Source <path to redis exe or URL to ZIP> -Config <path to cscfg file folder> -RedisConf <path to redis.conf file folder> -Domain <Azure domain> -Subscription <Azure subscription> [-X64] [--Pass <other parameters>]
If deploying to the Azure emulator, then use -Emu in place of -Domain and -Subscription.
Note that the Source may be to local Redis exe files, or may reference a GitHub zip file. If using a zip file, the 32 bit binaries are used by default. To use the 64 bit binaries include the optional -X64 parameter.
For example: -Source https://github.com/MSOpenTech/redis/archive/2.4.zip will download the zip file for the latest code for branch 2.4.
The --Pass (note the double '-') parameter is optional. Any parameters following this are passed on to Inst4WA. This is useful to override settings such as region or slot. See the Pass-through parameters section.
### Deployment notes
If deploying to the Azure emulator, you will need to manually remove the deployment after you have finished testing. You should also remove a previous deployment before trying to deploy a second time.
After downloading files, you may have to unblock the DLLs to enable them to be used. Please follow instructions at [http://msdn.microsoft.com/en-us/library/ee890038(VS.100).aspx](http://msdn.microsoft.com/en-us/library/ee890038(VS.100).aspx)
### Pass-through parameters
* StorageAccountName - default DomainName + 'stg'
* DeploymentName - default DomainName + 'deploy'
* Region - default 'West US'
* DeploymentOption - default 'Production'
* PublishSettingsFilePath - default is any file in Config folder with publishsettings extension.
Configuring the deployment
--------------------------
ServiceDefinition.csdef defines the roles to be deployed.
- Port numbers to use are defined here for each role.
- You also set the VMSize for each role.
- The sample defines a Startup task that runs startup.cmd. This opens the firewall ports for redis-server.exe. You should follow the sample if you create your own csdef file.
The cscfg file contains settings used by the Azure roles.
- The osFamily attribute in the samples is set to "1" for Win2K8R2. You can change this to use a different OS.
To enable RDP to the Azure roles, you need to define the certificates that you will use for RDP to Azure in the cscfg file. To define the certificate, add an XML element under each Role that specifies the thumbprint for the certificate you are using.
For example:
> <Role name="RedisMaster">
>
> <Certificates>
> <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption"
> thumbprint="2CF79A6E4B88031BB3C70B3A6A26D86F2F687111"
> thumbprintAlgorithm="sha1" />
> </Certificates>
> </Role>
>
Implementation detail
---------------------
RedisInstWA creates a folder in the current working directory called RedisInstWork. All the files necessary for deployment are copied here.
It makes a copy of the redis exe files to deploy in the release sub folder. It copies the redis.conf file here. It also creates an XmlConfig.xml file that is used as input by the Inst4WA application.
Once this is done, it launches Inst4WA. Inst4WA uses the XmlConfig.xml file as input to pass parameters to Powershell cmdlets for doing the Azure deployment. You can view this xml file to view the parameters passed to the cmdlets. This may be useful in determining if you want to use pass-through parameters.
The subfolder DeployRedis is used by the installer to create the package to be sent to Azure.
Troubleshooting
---------------
The installer may fail for several reasons. Each step in the installation produces text output in the command window to help you understand where it failed.
If there was a failure coming from Azure, the text message may not contain the information that you need to understand why it failed.
In this case you should inspect the operation logs using the Azure portal. In the portal page select the settings tab on the left. From there select the operational logs on the top. You may need to scroll to find the most recent logs. Click on the relevant log entry to view the failure message.
Building the sources
--------------------
To build the sources load the RedisWaInst solution in Visual Studio 2010, select the Release configuration and Build.
Binaries will be placed in a folder called RedisInstBin. The binaries in the bin folder will not be replaced. If you need to modify the bin folder executables, copy the updated binaries from src\RedisInstBin.
Acknowledgements
----------------
The Inst4WA binaries were obtained from [https://github.com/MSOpenTech/inst4wa](https://github.com/MSOpenTech/inst4wa).
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="Redis.WorkerRole" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*" schemaVersion="2012-05.1.8">
<Role name="RedisMaster">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="DataConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="CloudDriveSize" value="4096" />
</ConfigurationSettings>
</Role>
<Role name="RedisSlave">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="RedisMasterHostWorkerRoleExternalEndpointPort" value="6379" />
<Setting name="DataConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="CloudDriveSize" value="4096" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="Redis.WorkerRole" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*" schemaVersion="2012-10.1.8">
<Role name="RedisMaster">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="DataConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="CloudDriveSize" value="4096" />
</ConfigurationSettings>
<Certificates></Certificates>
</Role>
<Role name="RedisSlave">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="RedisMasterHostWorkerRoleExternalEndpointPort" value="6379" />
<Setting name="DataConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="CloudDriveSize" value="4096" />
</ConfigurationSettings>
<Certificates></Certificates>
</Role>
</ServiceConfiguration>
@@ -1,53 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="Redis.WorkerRole" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
<WorkerRole name="RedisMaster" vmsize="Small">
<Runtime executionContext="elevated">
<EntryPoint>
<NetFxEntryPoint assemblyName="RedisServer.dll" targetFrameworkVersion="v4.0" />
</EntryPoint>
</Runtime>
<Startup>
<Task taskType="simple" commandLine="startup.cmd" executionContext="elevated">
<Environment></Environment>
</Task>
</Startup>
<Endpoints>
<InternalEndpoint name="RedisMasterServiceEndpoint" protocol="tcp"/>
<InputEndpoint name="RedisMasterEndpoint" protocol="tcp" port="6379" localPort="6380"/>
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<ConfigurationSettings>
<Setting name="DataConnectionString" />
<!--<Setting name="RedisMasterHostWorkerRoleExternalEndpointPort" />-->
<Setting name="CloudDriveSize" />
</ConfigurationSettings>
</WorkerRole>
<WorkerRole name="RedisSlave" vmsize="Small">
<Runtime executionContext="elevated">
<EntryPoint>
<NetFxEntryPoint assemblyName="RedisServer.dll" targetFrameworkVersion="v4.0" />
</EntryPoint>
</Runtime>
<Startup>
<Task taskType="simple" commandLine="startup.cmd" executionContext="elevated">
<Environment></Environment>
</Task>
</Startup>
<Endpoints>
<InternalEndpoint name="RedisSlaveServiceEndpoint" protocol="tcp"/>
<InputEndpoint name="RedisSlave" protocol="tcp" port="6179" localPort="6180" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<ConfigurationSettings>
<Setting name="DataConnectionString" />
<Setting name="RedisMasterHostWorkerRoleExternalEndpointPort" />
<Setting name="CloudDriveSize" />
</ConfigurationSettings>
</WorkerRole>
</ServiceDefinition>
-418
View File
@@ -1,418 +0,0 @@
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
# units are case insensitive so 1GB 1Gb 1gB are all the same.
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize no
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
# default. You can specify a custom pid file location here.
pidfile /var/run/redis.pid
# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
#port 6179
# If you want you can bind a single interface, if the bind option is not
# specified all the interfaces will listen for incoming connections.
#
# bind 127.0.0.1
# Specify the path for the unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
# unixsocket /tmp/redis.sock
# unixsocketperm 755
# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
# Set server verbosity to 'debug'
# it can be one of:
# debug (a lot of information, useful for development/testing)
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
loglevel verbose
# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
logfile stdout
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
# syslog-enabled no
# Specify the syslog identity.
# syslog-ident redis
# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
# syslog-facility local0
# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
# dbid is a number between 0 and 'databases'-1
databases 16
################################ SNAPSHOTTING #################################
#
# Save the DB on disk:
#
# save <seconds> <changes>
#
# Will save the DB if both the given number of seconds and the given
# number of write operations against the DB occurred.
#
# In the example below the behaviour will be to save:
# after 900 sec (15 min) if at least 1 key changed
# after 300 sec (5 min) if at least 10 keys changed
# after 60 sec if at least 10000 keys changed
#
# Note: you can disable saving at all commenting all the "save" lines.
save 900 1
save 300 10
save 60 10000
# Compress string objects using LZF when dump .rdb databases?
# For default that's set to 'yes' as it's almost always a win.
# If you want to save some CPU in the saving child set it to 'no' but
# the dataset will likely be bigger if you have compressible values or keys.
rdbcompression yes
# The filename where to dump the DB
dbfilename dump.rdb
# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# Also the Append Only File will be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir ./
################################# REPLICATION #################################
# Master-Slave replication. Use slaveof to make a Redis instance a copy of
# another Redis server. Note that the configuration is local to the slave
# so for example it is possible to configure the slave to save the DB with a
# different interval, or to listen to another port, and so on.
#
# slaveof <masterip> <masterport>
# If the master is password protected (using the "requirepass" configuration
# directive below) it is possible to tell the slave to authenticate before
# starting the replication synchronization process, otherwise the master will
# refuse the slave request.
#
# masterauth <master-password>
# When a slave lost the connection with the master, or when the replication
# is still in progress, the slave can act in two different ways:
#
# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
# still reply to client requests, possibly with out of data data, or the
# data set may just be empty if this is the first synchronization.
#
# 2) if slave-serve-stale data is set to 'no' the slave will reply with
# an error "SYNC with master in progress" to all the kind of commands
# but to INFO and SLAVEOF.
#
slave-serve-stale-data yes
# Slaves send PINGs to server in a predefined interval. It's possible to change
# this interval with the repl_ping_slave_period option. The default value is 10
# seconds.
#
# repl-ping-slave-period 10
# The following option sets a timeout for both Bulk transfer I/O timeout and
# master data or ping response timeout. The default value is 60 seconds.
#
# It is important to make sure that this value is greater than the value
# specified for repl-ping-slave-period otherwise a timeout will be detected
# every time there is low traffic between the master and the slave.
#
# repl-timeout 60
################################## SECURITY ###################################
# Require clients to issue AUTH <PASSWORD> before processing any other
# commands. This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
# requirepass foobared
# Command renaming.
#
# It is possilbe to change the name of dangerous commands in a shared
# environment. For instance the CONFIG command may be renamed into something
# of hard to guess so that it will be still available for internal-use
# tools but not available for general clients.
#
# Example:
#
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
#
# It is also possilbe to completely kill a command renaming it into
# an empty string:
#
# rename-command CONFIG ""
################################### LIMITS ####################################
# Set the max number of connected clients at the same time. By default there
# is no limit, and it's up to the number of file descriptors the Redis process
# is able to open. The special value '0' means no limits.
# Once the limit is reached Redis will close all the new connections sending
# an error 'max number of clients reached'.
#
# maxclients 128
# Don't use more memory than the specified amount of bytes.
# When the memory limit is reached Redis will try to remove keys
# accordingly to the eviction policy selected (see maxmemmory-policy).
#
# If Redis can't remove keys according to the policy, or if the policy is
# set to 'noeviction', Redis will start to reply with errors to commands
# that would use more memory, like SET, LPUSH, and so on, and will continue
# to reply to read-only commands like GET.
#
# This option is usually useful when using Redis as an LRU cache, or to set
# an hard memory limit for an instance (using the 'noeviction' policy).
#
# WARNING: If you have slaves attached to an instance with maxmemory on,
# the size of the output buffers needed to feed the slaves are subtracted
# from the used memory count, so that network problems / resyncs will
# not trigger a loop where keys are evicted, and in turn the output
# buffer of slaves is full with DELs of keys evicted triggering the deletion
# of more keys, and so forth until the database is completely emptied.
#
# In short... if you have slaves attached it is suggested that you set a lower
# limit for maxmemory so that there is some free RAM on the system for slave
# output buffers (but this is not needed if the policy is 'noeviction').
#
# maxmemory <bytes>
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached? You can select among five behavior:
#
# volatile-lru -> remove the key with an expire set using an LRU algorithm
# allkeys-lru -> remove any key accordingly to the LRU algorithm
# volatile-random -> remove a random key with an expire set
# allkeys->random -> remove a random key, any key
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
# noeviction -> don't expire at all, just return an error on write operations
#
# Note: with all the kind of policies, Redis will return an error on write
# operations, when there are not suitable keys for eviction.
#
# At the date of writing this commands are: set setnx setex append
# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
# getset mset msetnx exec sort
#
# The default is:
#
# maxmemory-policy volatile-lru
# LRU and minimal TTL algorithms are not precise algorithms but approximated
# algorithms (in order to save memory), so you can select as well the sample
# size to check. For instance for default Redis will check three keys and
# pick the one that was used less recently, you can change the sample size
# using the following configuration directive.
#
# maxmemory-samples 3
############################## APPEND ONLY MODE ###############################
# By default Redis asynchronously dumps the dataset on disk. If you can live
# with the idea that the latest records will be lost if something like a crash
# happens this is the preferred way to run Redis. If instead you care a lot
# about your data and don't want to that a single record can get lost you should
# enable the append only mode: when this mode is enabled Redis will append
# every write operation received in the file appendonly.aof. This file will
# be read on startup in order to rebuild the full dataset in memory.
#
# Note that you can have both the async dumps and the append only file if you
# like (you have to comment the "save" statements above to disable the dumps).
# Still if append only mode is enabled Redis will load the data from the
# log file at startup ignoring the dump.rdb file.
#
# IMPORTANT: Check the BGREWRITEAOF to check how to rewrite the append
# log file in background when it gets too big.
appendonly no
# The name of the append only file (default: "appendonly.aof")
# appendfilename appendonly.aof
# The fsync() call tells the Operating System to actually write data on disk
# instead to wait for more data in the output buffer. Some OS will really flush
# data on disk, some other OS will just try to do it ASAP.
#
# Redis supports three different modes:
#
# no: don't fsync, just let the OS flush the data when it wants. Faster.
# always: fsync after every write to the append only log . Slow, Safest.
# everysec: fsync only if one second passed since the last fsync. Compromise.
#
# The default is "everysec" that's usually the right compromise between
# speed and data safety. It's up to you to understand if you can relax this to
# "no" that will will let the operating system flush the output buffer when
# it wants, for better performances (but if you can live with the idea of
# some data loss consider the default persistence mode that's snapshotting),
# or on the contrary, use "always" that's very slow but a bit safer than
# everysec.
#
# If unsure, use "everysec".
# appendfsync always
appendfsync everysec
# appendfsync no
# When the AOF fsync policy is set to always or everysec, and a background
# saving process (a background save or AOF log background rewriting) is
# performing a lot of I/O against the disk, in some Linux configurations
# Redis may block too long on the fsync() call. Note that there is no fix for
# this currently, as even performing fsync in a different thread will block
# our synchronous write(2) call.
#
# In order to mitigate this problem it's possible to use the following option
# that will prevent fsync() from being called in the main process while a
# BGSAVE or BGREWRITEAOF is in progress.
#
# This means that while another child is saving the durability of Redis is
# the same as "appendfsync none", that in pratical terms means that it is
# possible to lost up to 30 seconds of log in the worst scenario (with the
# default Linux settings).
#
# If you have latency problems turn this to "yes". Otherwise leave it as
# "no" that is the safest pick from the point of view of durability.
no-appendfsync-on-rewrite no
# Automatic rewrite of the append only file.
# Redis is able to automatically rewrite the log file implicitly calling
# BGREWRITEAOF when the AOF log size will growth by the specified percentage.
#
# This is how it works: Redis remembers the size of the AOF file after the
# latest rewrite (or if no rewrite happened since the restart, the size of
# the AOF at startup is used).
#
# This base size is compared to the current size. If the current size is
# bigger than the specified percentage, the rewrite is triggered. Also
# you need to specify a minimal size for the AOF file to be rewritten, this
# is useful to avoid rewriting the AOF file even if the percentage increase
# is reached but it is still pretty small.
#
# Specify a precentage of zero in order to disable the automatic AOF
# rewrite feature.
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
################################## SLOW LOG ###################################
# The Redis Slow Log is a system to log queries that exceeded a specified
# execution time. The execution time does not include the I/O operations
# like talking with the client, sending the reply and so forth,
# but just the time needed to actually execute the command (this is the only
# stage of command execution where the thread is blocked and can not serve
# other requests in the meantime).
#
# You can configure the slow log with two parameters: one tells Redis
# what is the execution time, in microseconds, to exceed in order for the
# command to get logged, and the other parameter is the length of the
# slow log. When a new command is logged the oldest one is removed from the
# queue of logged commands.
# The following time is expressed in microseconds, so 1000000 is equivalent
# to one second. Note that a negative number disables the slow log, while
# a value of zero forces the logging of every command.
slowlog-log-slower-than 10000
# There is no limit to this length. Just be aware that it will consume memory.
# You can reclaim memory used by the slow log with SLOWLOG RESET.
slowlog-max-len 1024
############################### ADVANCED CONFIG ###############################
# Hashes are encoded in a special way (much more memory efficient) when they
# have at max a given numer of elements, and the biggest element does not
# exceed a given threshold. You can configure this limits with the following
# configuration directives.
hash-max-zipmap-entries 512
hash-max-zipmap-value 64
# Similarly to hashes, small lists are also encoded in a special way in order
# to save a lot of space. The special representation is only used when
# you are under the following limits:
list-max-ziplist-entries 512
list-max-ziplist-value 64
# Sets have a special encoding in just one case: when a set is composed
# of just strings that happens to be integers in radix 10 in the range
# of 64 bit signed integers.
# The following configuration setting sets the limit in the size of the
# set in order to use this special memory saving encoding.
set-max-intset-entries 512
# Similarly to hashes and lists, sorted sets are also specially encoded in
# order to save a lot of space. This encoding is only used when the length and
# elements of a sorted set are below the following limits:
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
# order to help rehashing the main Redis hash table (the one mapping top-level
# keys to values). The hash table implementation redis uses (see dict.c)
# performs a lazy rehashing: the more operation you run into an hash table
# that is rhashing, the more rehashing "steps" are performed, so if the
# server is idle the rehashing is never complete and some more memory is used
# by the hash table.
#
# The default is to use this millisecond 10 times every second in order to
# active rehashing the main dictionaries, freeing memory when possible.
#
# If unsure:
# use "activerehashing no" if you have hard latency requirements and it is
# not a good thing in your environment that Redis can reply form time to time
# to queries with 2 milliseconds delay.
#
# use "activerehashing yes" if you don't have such hard requirements but
# want to free memory asap when possible.
activerehashing yes
################################## INCLUDES ###################################
# Include one or more other config files here. This is useful if you
# have a standard template that goes to all redis server but also need
# to customize a few per-server settings. Include files can include
# other files, so use this wisely.
#
# include /path/to/local.conf
# include /path/to/other.conf
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PublishData>
<PublishProfile
PublishMethod="AzureServiceManagementAPI"
Url="https://management.core.windows.net/"
ManagementCertificate="">
<Subscription
Id=""
Name="" />
</PublishProfile>
</PublishData>
Binary file not shown.
Binary file not shown.
@@ -1,139 +0,0 @@
<#
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
#>
Add-Type -AssemblyName System.ServiceModel.Web, System.Runtime.Serialization
$remotesetup1file = $args[0]
$mylocation = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path)
Set-Location $mylocation
function logStatus {
param ($message)
Write-Host "info: $message" -foregroundcolor "yellow"
}
function logStatus2 {
param ($message)
Write-Host "info: $message" -foregroundcolor "blue"
}
function logErr {
param ($message)
Write-Host "error: $message" -foregroundcolor "red"
}
function logSuccess {
param ($message)
Write-Host "info: $message" -foregroundcolor "green"
}
function logInput {
param ($message)
Write-Host "input: $message" -foregroundcolor "magenta"
}
<#
Display the usage
#>
function showUsageAndExit() {
Write-Host "`r`nUSAGE: remote-setup.ps1 <OSSInstallScript> <Service> <Admin-Password> <WinRM-EndPointName-Prefix> `r`n" -foregroundcolor "green"
exit 1
}
# Gets the commandline arguments
if($args.Count -ne 4)
{
logErr "Missing required arguments`r`n"
showUsageAndExit
}
<#
Reads the configuration file config.json
#>
function get-Config([string]$service, [string]$adminPassword, [string]$winrmEpName)
{
[hashtable]$result = @{}
$result.dnsPrefix = $service
$result.dns = $service + ".cloudapp.net"
$result.user = "Administrator"
$result.password = $adminPassword
$result.ports = @();
$result.ips = @();
$vmDetails = @(Get-AzureVM -ServiceName $service | select-object *)
if($vmDetails.length -le 0)
{
Throw "Unable to get VM details."
}
$endpointSearchCriteria = "*" + $winrmEpName + "*"
foreach($eachVmDetail in $vmDetails)
{
$endpoints = @(Get-AzureVM -ServiceName $service -name $eachVmDetail.Name | Get-AzureEndPoint | where-object {$_.Name -like $endpointSearchCriteria })
$result.ports += $endpoints[0].Port
$result.ips += $eachVmDetail.IpAddress
}
return $result;
}
logStatus "Reading the configuration file.."
$result = get-Config $args[1] $args[2] $args[3]
logStatus ("DNS: " + $result.Get_Item("dns"))
logStatus ("VM IP Addresses:" + $result.Get_Item("ips"))
$secpasswd = ConvertTo-SecureString $result.Get_Item("password") -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($result.Get_Item("user"), $secpasswd)
# After VM's are in ready state it takes some time to reach the VM in a state in which
# it can accept the request, so waiting for 30 seconds
Start-Sleep -s 30
# Runs the remote setup script in each VM, do retry if the connection fails.
foreach ($port in $result.Get_Item("ports")) {
logStatus ("Running setup on " + $result.Get_Item("dns") + ":" + $port)
$retry = 0;
do {
$success = $false;
try
{
Invoke-Command -ComputerName $result.Get_Item("dns") -Port $port -Credential $cred -FilePath $args[0] -ArgumentList ($result.Get_Item("ips")) -ErrorAction Stop
$success = $true
}
catch [Exception]
{
If ($_.Exception -is [System.Management.Automation.Remoting.PSRemotingTransportException]) {
if ($retry -ge 10) {
$_.Exception.GetType().FullName
logErr ("Connection to WinRM service running on $port failed after $retry retry, moving to next VM")
break
} else {
logStatus2 ("Connection to WinRM service running on $port failed.. Retrying#" + $retry)
Start-Sleep -s (20 + $retry*5)
$retry++;
}
} Else {
throw $_.Exception
}
}
} while (!$success);
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -1,2 +0,0 @@
@echo off
netsh advfirewall firewall add rule name="redis" dir=in action=allow enable=yes program="release\\redis-server.exe"
@@ -1,52 +0,0 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Management.Automation;
using System.Security.Permissions;
namespace RedisDeployCmdlets
{
[Cmdlet(VerbsCommon.Add, "RedisConfigOptions")]
public class AddRedisConfigOptions : PSCmdlet
{
[Parameter(Mandatory = true, HelpMessage = "Set the master port")]
public string ListenPort { get; set; }
[Parameter(Mandatory = true, HelpMessage = "Path to the redis configure file")]
public string Path { get; set; }
[Parameter(Mandatory = false, HelpMessage = "Set the master url")]
public string MasterUrl { get; set; }
[Parameter(Mandatory = false, HelpMessage = "Set the master port")]
public string MasterPort { get; set; }
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
protected override void ProcessRecord()
{
base.ProcessRecord();
try
{
string opt = String.Format("port {0}\n", ListenPort);
if (!String.IsNullOrEmpty(MasterUrl) && !String.IsNullOrEmpty(MasterPort))
{
if (MasterUrl.ToUpper() != "LOCALHOST")
{
MasterUrl += ".cloudapp.net";
}
opt += String.Format("slaveof {0} {1}\n", MasterUrl, MasterPort);
}
File.AppendAllText(Path, String.Concat(opt));
}
catch (Exception ex)
{
WriteError(new ErrorRecord(ex, string.Empty, ErrorCategory.CloseError, null));
throw;
}
}
}
}
@@ -1,58 +0,0 @@
#region Copyright Notice
/*
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
#endregion
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("RedisDeployCmdlets")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RedisDeployCmdlets")]
[assembly: AssemblyCopyright("Copyright © Microsoft Open Technologies, Inc.")]
[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("ad1aed47-c88e-4fd0-affc-86621f4cbc23")]
// 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")]
@@ -1,83 +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)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2F9BEF35-EB38-41C1-9A2E-136702720EE9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RedisDeployCmdlets</RootNamespace>
<AssemblyName>RedisDeployCmdlets</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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|AnyCPU' ">
<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.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<Compile Include="AddRedisConfigOptions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="RedisDeployCmdlets.psd1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.dll" "$(SolutionDir)RedisInstBin"
XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.pdb" "$(SolutionDir)RedisInstBin"
XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.xml" "$(SolutionDir)RedisInstBin"
XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.psd1" "$(SolutionDir)RedisInstBin"
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,120 +0,0 @@
#region Copyright Notice
/*
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using System.Threading;
namespace RedisInstWA
{
public delegate void Print(String message);
/// <summary>
/// Code to download file copied from Inst4WA
/// </summary>
public class DownloadHelper : IDisposable
{
private AutoResetEvent threadBlocker;
private int downloadProgress;
private bool isSuccessful;
private Exception error;
public void Download(Uri url, string saveLoc)
{
try
{
using (WebClient setupDownloader = new WebClient())
{
setupDownloader.DownloadProgressChanged += new DownloadProgressChangedEventHandler(setupDownloader_DownloadProgressChanged);
setupDownloader.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(setupDownloader_DownloadFileCompleted);
setupDownloader.DownloadFileAsync(url, saveLoc);
Console.WriteLine("Downloading - ");
threadBlocker = new AutoResetEvent(false);
threadBlocker.WaitOne();
}
if (isSuccessful == false)
{
throw error;
}
}
finally
{
if (threadBlocker != null)
{
threadBlocker.Close();
threadBlocker = null;
}
}
}
private void setupDownloader_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
if ((e.ProgressPercentage % 10 == 0) && (e.ProgressPercentage > downloadProgress))
{
downloadProgress = e.ProgressPercentage;
Console.Write(String.Concat(" ", e.ProgressPercentage, "%"));
}
}
private void setupDownloader_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
if (e.Error == null)
{
isSuccessful = true;
}
else
{
isSuccessful = false;
error = e.Error;
}
Console.WriteLine();
threadBlocker.Set();
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
// free managed resources
if (threadBlocker != null)
{
threadBlocker.Close();
threadBlocker = null;
}
}
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}
@@ -1,133 +0,0 @@
#region Copyright Notice
/*
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
#endregion
namespace RedisInstWA
{
using Shell32;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
/// <summary>
/// Download zip from URL and extract files
/// </summary>
public class ExtractZip
{
public void Download(string url, string path)
{
DownloadHelper down = new DownloadHelper();
Uri uri = new Uri(url);
down.Download(uri, path);
}
public string FindBinZip(string path, string binzip)
{
IEnumerable<string> subdirs = Directory.EnumerateDirectories(path);
if (subdirs != null && subdirs.Count() > 0)
{
string subpath = Path.Combine(path, subdirs.First());
string binpath = Path.Combine(subpath, @"msvs\bin\release\", binzip);
if (File.Exists(binpath))
{
return binpath;
}
else
{
// bin folder moved in later versions.
binpath = Path.Combine(subpath, @"bin\release\", binzip);
if (File.Exists(binpath))
{
return binpath;
}
}
}
return null;
}
public void ExtractFilesFromZip(string src, string dest)
{
Shell sh = new Shell();
Folder inzip = sh.NameSpace(src);
Folder outdir = sh.NameSpace(dest);
outdir.CopyHere(inzip.Items(), 0); // 4 for no progress dialog, 16 for Yes to all
}
public int DownloadAndExtract(string zipurl, string workPath, string binfolder, bool isX64)
{
string zippath = Path.Combine(workPath, "zipfile");
if (!FolderHelper.MakeFolderReset(zippath))
return 5;
try
{
string zipfile = Path.Combine(zippath, "redis.zip");
Download(zipurl, zipfile);
IEnumerable<string> subfiles = Directory.EnumerateFiles(zippath);
if (!File.Exists(zipfile))
{
// download did nothing
Console.WriteLine("Downloading zip file failed");
return 1;
}
// unzip the downloaded file
ExtractFilesFromZip(zipfile, zippath);
string binzip = isX64 ? "redisbin64.zip" : "redisbin.zip";
string embeddedzip = FindBinZip(zippath, binzip);
if (embeddedzip == null)
{
// binaries zip not found
Console.WriteLine("Did not find {0} in downloaded zip file", binzip);
return 2;
}
string binpath = Path.Combine(workPath, binfolder);
if (!FolderHelper.MakeFolderReset(binpath))
return 5;
ExtractFilesFromZip(embeddedzip, binpath);
IEnumerable<string> exefiles = Directory.EnumerateFiles(binpath, "redis-server.exe", SearchOption.AllDirectories);
if (exefiles == null || exefiles.Count() == 0)
{
// executable not found
Console.WriteLine("Extracting redis-server from zip failed");
return 3;
}
}
catch (Exception ex)
{
if (ex.InnerException != null)
Console.WriteLine(ex.InnerException.Message);
else
Console.WriteLine(ex.Message);
return 4;
}
return 0;
}
}
}
@@ -1,96 +0,0 @@
#region Copyright Notice
/*
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
#endregion
namespace RedisInstWA
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.AccessControl;
using System.Text;
/// <summary>
/// Utility methods for directories and files
/// </summary>
public static class FolderHelper
{
/// <summary>
/// Make a folder if doesn't exist
/// </summary>
/// <param name="folderPath"></param>
/// <returns></returns>
public static bool MakeFolder(string folderPath)
{
if (!Directory.Exists(folderPath))
{
try
{
DirectorySecurity securityRules = new DirectorySecurity();
securityRules.AddAccessRule(new FileSystemAccessRule("Users", FileSystemRights.FullControl,
InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit,
PropagationFlags.NoPropagateInherit,
AccessControlType.Allow));
Directory.CreateDirectory(folderPath, securityRules);
File.SetAttributes(folderPath, FileAttributes.Normal);
}
catch (Exception ex)
{
Console.WriteLine("Exception trying to create folder: " + folderPath);
if (ex.InnerException != null)
Console.WriteLine(ex.InnerException.Message);
else
Console.WriteLine(ex.Message);
return false;
}
}
return true;
}
public static bool MakeFolderReset(string folderPath)
{
if (Directory.Exists(folderPath))
{
try
{
// make sure it is empty to start
Directory.Delete(folderPath, true);
}
catch (Exception ex)
{
Console.WriteLine("Exception trying to delete folder: " + folderPath);
if (ex.InnerException != null)
Console.WriteLine(ex.InnerException.Message);
else
Console.WriteLine(ex.Message);
return false;
}
}
MakeFolder(folderPath);
return true;
}
}
}
@@ -1,342 +0,0 @@
#region Copyright Notice
/*
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
#endregion
namespace RedisInstWA
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
/// <summary>
/// Create XML file to control Inst4WA utility
/// </summary>
public class InstWaXml
{
//Fragments of the XML file to control Inst4WA are defined here
// The parameters are used to customize the XML file
private const string instXmlSkeleton =
@"<DeploymentModel xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<Parameters>
{0}
</Parameters>
<Steps>
{1}
</Steps>
</DeploymentModel>
";
// emul value is true or false
private const string instXmlEmul =
@" <!-- Emulator parameter is required. Yes or No -->
<Parameter Name=""Emulator"" Value=""{0}""></Parameter>
";
// Set up folder path variables
// {0} is work folder path
// {1} is Redis Azure installer binaries folder path
// {2} is subfolder for redis exe files (binaries)
// {3} is path to csdef and cscfg files
// {4} is path to redis.conf input file
private const string instXmlRoot =
@" <!-- replaceable values for root dir-->
<Parameter Name=""RootDir"" Value=""{0}""></Parameter>
<Parameter Name=""BinDir"" Value=""{1}""></Parameter>
<Parameter Name=""RedisServerDir"" Value=""{0}\{2}""></Parameter>
<Parameter Name=""RedisPkgDir"" Value=""{1}\RedisPkgBin""></Parameter>
<Parameter Name=""AzureConfigDir"" Value=""{3}""></Parameter>
<Parameter Name=""RedisConfFile"" Value=""{4}\redis.conf""></Parameter>
<Parameter Name=""AppFolder"" ValuePrefixRef=""RootDir"" ValueSuffix=""\DeployRedis""></Parameter>
<Parameter Name=""AppName"" Value=""RedisAzure""></Parameter>
";
// Set up publish setting file path
// {0} is file path path
private const string instXmlPubSettingsFile =
@" <!-- value for publish settings -->
<Parameter Name=""PublishSettingsFilePath"" Value=""{0}""></Parameter>
";
// paths for SDK components
private const string instXmlSDK =
@" <!-- assemblies and SDKs -->
<Parameter Name=""AzureDeploymentCmdletsAssemblyPath""
Value=""%%Program Files%%\Microsoft SDKs\Windows Azure\PowerShell\Azure\Microsoft.WindowsAzure.Management.CloudService.dll"" Required=""yes""></Parameter>
<Parameter Name=""AzureMgmtCmdletsAssemblyPath""
Value=""%%Program Files%%\Microsoft SDKs\Windows Azure\PowerShell\Azure\Microsoft.WindowsAzure.Management.dll"" Required=""yes""></Parameter>
<Parameter Name=""RedisDeployCmdletsAssemblyPath""
ValuePrefixRef=""BinDir"" ValueSuffix=""\RedisDeployCmdlets.dll"" Required=""yes""></Parameter>
<Parameter Name=""AzureNodeJsSdkPath"" Value=""%%Program Files%%\Microsoft SDKs\Windows Azure\PowerShell\Azure""></Parameter>
";
// Azure settings
// {0} is Domain
// {1} is subscription
private const string instXmlAzure =
@" <Parameter Name=""DomainName"" Value=""{0}"" Required=""yes""></Parameter>
<Parameter Name=""Subscription"" Value=""{1}"" Required=""yes""></Parameter>
<Parameter Name=""StorageAccountName"" ValuePrefixRef=""DomainName"" ValueSuffix=""stg"" Required=""yes""></Parameter>
<Parameter Name=""DeploymentName"" ValuePrefixRef=""DomainName"" ValueSuffix=""deploy"" Required=""yes""></Parameter>
<Parameter Name=""Region"" Value=""West US""></Parameter>
<Parameter Name=""DeploymentOption"" Value=""Production""></Parameter>
";
// Config files
// {0} is local or cloud
private const string instXmlAzureCfg =
@" <Parameter Name=""CSCFGFile"" ValuePrefixRef=""AzureConfigDir"" ValueSuffix=""\ServiceConfiguration.{0}.cscfg""></Parameter>
<Parameter Name=""CSDEFFile"" ValuePrefixRef=""AzureConfigDir"" ValueSuffix=""\ServiceDefinition.csdef""></Parameter>
";
// Roles
// {0} is role index
// {1} is role name
// {2} is role internal listening port
private const string instXmlRole =
@" <Parameter Name=""RoleName{0}"" Value=""{1}""></Parameter>
<Parameter Name=""RoleDest{0}"" ValuePrefixRef=""AppFolder"" ValueSuffix=""\RedisAzure\{1}""></Parameter>
<Parameter Name=""RolePort{0}"" Value=""{2}""></Parameter>
<Parameter Name=""RoleRedisConf{0}"" ValuePrefixRef=""RoleDest{0}"" ValueSuffix=""\redis.conf""></Parameter>
";
// Master role
// {0} is master port (external)
// {1} is master host name or IP
private const string instXmlMasterRole =
@" <Parameter Name=""MasterPort"" Value=""{0}""></Parameter>
<Parameter Name=""MasterHost"" Value=""{1}""></Parameter>
";
// common steps to add assemblies and create folder
private const string instXmlStepPrep =
@" <Step Type=""Cmdlet"" Command=""Install-AzureSdkForNodeJs"" Message=""Installing Windows Azure PowerShell for Node.JS"">
<CommandParam Name=""AzureNodeSdkLoc"" ParameterName=""AzureNodeJsSdkPath"" />
</Step>
<!--Load Azure SDK Dll's-->
<Step Type=""Cmdlet"" Command=""Add-LoadAssembly"" Message=""Loading Windows Azure PowerShell for Node.JS"">
<CommandParam Name=""CmdletsAssemblyPath"" ParameterName=""AzureDeploymentCmdletsAssemblyPath"" />
</Step>
<Step Type=""Cmdlet"" Command=""Add-LoadAssembly"" Message=""Loading Windows Azure PowerShell for Node.JS"">
<CommandParam Name=""CmdletsAssemblyPath"" ParameterName=""AzureMgmtCmdletsAssemblyPath"" />
</Step>
<Step Type=""Cmdlet"" Command=""Add-LoadAssembly"" Message=""Loading RedisDeployCmdlets"">
<CommandParam Name=""CmdletsAssemblyPath"" ParameterName=""RedisDeployCmdletsAssemblyPath"" />
</Step>
<!--Create Empty App-->
<Step Type=""Cmdlet"" Command=""New-ApplicationDirectory"" Message=""Creating application directory"">
<CommandParam Name=""AppFolder"" ParameterName=""AppFolder"" />
</Step>
<Step Message=""Changing to application directory"" Command="""" Type=""ChangeWorkingDir"">
<CommandParam Name=""WorkingDir"" ParameterName=""AppFolder""/>
</Step>
<Step Message=""Creating new Azure service"" Command=""New-AzureServiceProject"" Type=""Cmdlet"">
<CommandParam Name=""ServiceName"" ParameterName=""AppName""/>
</Step>
";
// steps to publish settings if not emul
private const string instXmlStepPrepProd =
@" <Step Type=""Cmdlet"" Command=""Import-AzurePublishSettingsFile"" Message=""Importing Publish settings"">
<CommandParam Name=""PublishSettingsFile"" ParameterName=""PublishSettingsFilePath"" />
</Step>
";
// Master role install
// {0} is index for role - should be 0
private const string instXmlMasterRoleStep =
@" <Step Type=""Cmdlet"" Command=""DeployCmdlets4WA\Add-AzureWorkerRole"" Message=""Creating Redis worker role."">
<CommandParam Name=""RoleBinariesFolder"" ParameterName=""RedisPkgDir"" />
<CommandParam Name=""CSCFGFile"" ParameterName=""CSCFGFile"" />
<CommandParam Name=""CSDEFFile"" ParameterName=""CSDEFFile"" />
<CommandParam Name=""RoleName"" ParameterName=""RoleName{0}"" />
</Step>
<Step Type=""Cmdlet"" Command=""Copy-Item"" Message=""Copying Redis exe to role."">
<CommandParam Name=""Path"" ParameterName=""RedisServerDir"" />
<CommandParam Name=""Destination"" ParameterName=""RoleDest{0}"" />
<CommandParam Name=""Recurse"" ParameterName="""" />
</Step>
<Step Type=""Cmdlet"" Command=""Copy-Item"" Message=""Copying Redis.conf to role."">
<CommandParam Name=""Path"" ParameterName=""RedisConfFile"" />
<CommandParam Name=""Destination"" ParameterName=""RoleDest{0}"" />
</Step>
<Step Type=""Cmdlet"" Command=""Add-RedisConfigOptions"" Message=""Added config options to redis master .conf file."">
<CommandParam Name=""ListenPort"" ParameterName=""RolePort{0}"" />
<CommandParam Name=""Path"" ParameterName=""RoleRedisConf{0}"" />
</Step>
";
// Slave role install
// {0} is index for role
private const string instXmlSlaveRoleStep =
@" <Step Type=""Cmdlet"" Command=""DeployCmdlets4WA\Add-AzureWorkerRole"" Message=""Creating Redis worker role."">
<CommandParam Name=""RoleBinariesFolder"" ParameterName=""RedisPkgDir"" />
<CommandParam Name=""CSCFGFile"" ParameterName=""CSCFGFile"" />
<CommandParam Name=""CSDEFFile"" ParameterName=""CSDEFFile"" />
<CommandParam Name=""RoleName"" ParameterName=""RoleName{0}"" />
</Step>
<Step Type=""Cmdlet"" Command=""Copy-Item"" Message=""Copying Redis exe to role."">
<CommandParam Name=""Path"" ParameterName=""RedisServerDir"" />
<CommandParam Name=""Destination"" ParameterName=""RoleDest{0}"" />
<CommandParam Name=""Recurse"" ParameterName="""" />
</Step>
<Step Type=""Cmdlet"" Command=""Copy-Item"" Message=""Copying Redis.con to role."">
<CommandParam Name=""Path"" ParameterName=""RedisConfFile"" />
<CommandParam Name=""Destination"" ParameterName=""RoleDest{0}"" />
</Step>
<Step Type=""Cmdlet"" Command=""Add-RedisConfigOptions"" Message=""Added config options to redis master .conf file."">
<CommandParam Name=""ListenPort"" ParameterName=""RolePort{0}"" />
<CommandParam Name=""Path"" ParameterName=""RoleRedisConf{0}"" />
<CommandParam Name=""MasterUrl"" ParameterName=""MasterHost"" />
<CommandParam Name=""MasterPort"" ParameterName=""MasterPort"" />
</Step>
";
// Launch for emul
private const string instXmlLaunchEmul =
@" <Step Type=""Cmdlet"" Command=""Start-AzureEmulator -launch"" Message=""Deploying Redis inside Emulator"">
</Step>
";
// Launch for Azure
private const string instXmlDeployAzure =
@" <Step Type=""Cmdlet"" Command=""Set-AzureStorageAccountEx"" Message=""Configuring azure storage account"">
<CommandParam Name=""PublishSettingsFile"" ParameterName=""PublishSettingsFilePath"" />
<CommandParam Name=""StorageAccount"" ParameterName=""StorageAccountName"" />
<CommandParam Name=""Location"" ParameterName=""Region"" />
<CommandParam Name=""Subscription"" ParameterName=""Subscription"" />
</Step>
<Step Type=""Cmdlet"" Command=""Publish-AzureServiceProject -launch"" Message=""Deploying the app to Azure"">
<CommandParam Name=""ServiceName"" ParameterName=""DeploymentName"" />
<CommandParam Name=""StorageAccountName"" ParameterName=""StorageAccountName"" />
<CommandParam Name=""Slot"" ParameterName=""DeploymentOption"" />
<CommandParam Name=""Location"" ParameterName=""Region"" />
<CommandParam Name=""Subscription"" ParameterName=""Subscription"" />
</Step>
<Step Type=""Cmdlet"" Command=""Ping-ServiceEndpoints"" Message=""Verifying the Endpoints."">
<CommandParam Name=""PublishSettingsFile"" ParameterName=""PublishSettingsFilePath"" />
<CommandParam Name=""ServiceName"" ParameterName=""DeploymentName"" />
<CommandParam Name=""Subscription"" ParameterName=""Subscription"" />
</Step>
";
/// <summary>
/// Create the XmlConfig.xml file
/// </summary>
/// <param name="isEmul"></param>
/// <param name="configPath"></param>
/// <param name="redisConfPath"></param>
/// <param name="workPath"></param>
/// <param name="redisInstBinPath"></param>
/// <param name="redisBinSubFolder"></param>
/// <param name="domain"></param>
/// <param name="subscription"></param>
/// <param name="instances"></param>
/// <returns></returns>
public static bool CreateInstXml(bool isEmul,
string configPath,
string redisConfPath,
string workPath,
string redisInstBinPath,
string redisBinSubFolder,
string domain,
string subscription,
string pubSettingsFilePath,
List<RedisInstance> instances)
{
RedisInstance masterInst = instances[0];
int masterIndex = 0;
StringBuilder sbParams = new StringBuilder();
sbParams.AppendFormat(instXmlEmul, isEmul ? "true" : "false");
sbParams.AppendFormat(instXmlRoot, workPath, redisInstBinPath, redisBinSubFolder, configPath, redisConfPath);
sbParams.AppendFormat(instXmlPubSettingsFile, pubSettingsFilePath == null ? "" : pubSettingsFilePath);
sbParams.Append(instXmlSDK);
if (!isEmul)
{
sbParams.AppendFormat(instXmlAzure, domain, subscription);
}
sbParams.AppendFormat(instXmlAzureCfg, isEmul ? "local" : "cloud");
int roleIndex = 0;
foreach (RedisInstance inst in instances)
{
if (inst.IsMaster)
{
masterInst = inst;
masterIndex = roleIndex;
}
sbParams.AppendFormat(instXmlRole, roleIndex, inst.RoleName, inst.LocalPort);
roleIndex++;
}
sbParams.AppendFormat(instXmlMasterRole, masterInst.MasterPort, isEmul ? "localhost" : domain);
StringBuilder sbSteps = new StringBuilder();
sbSteps.Append(instXmlStepPrep);
if (!isEmul)
{
sbSteps.Append(instXmlStepPrepProd);
}
sbSteps.AppendFormat(instXmlMasterRoleStep, masterIndex);
roleIndex = 0;
foreach (RedisInstance inst in instances)
{
if (!inst.IsMaster)
{
sbSteps.AppendFormat(instXmlSlaveRoleStep, roleIndex);
}
roleIndex++;
}
if (isEmul)
{
sbSteps.Append(instXmlLaunchEmul);
}
else
{
sbSteps.Append(instXmlDeployAzure);
}
string xmlconfig = String.Format(instXmlSkeleton, sbParams.ToString(), sbSteps.ToString());
try
{
File.WriteAllText(Path.Combine(workPath, "XmlConfig.xml"), xmlconfig, Encoding.UTF8);
}
catch (Exception ex)
{
if (ex.InnerException != null)
Console.WriteLine(ex.InnerException.Message);
else
Console.WriteLine(ex.Message);
return false;
}
Console.WriteLine("XmlConfig file for Inst4WA written as");
Console.WriteLine(Path.Combine(workPath, "XmlConfig.xml"));
return true;
}
}
}
@@ -1,99 +0,0 @@
#region Copyright Notice
/*
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
#endregion
namespace RedisInstWA
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.XPath;
using System.Xml;
/// <summary>
/// Parse the csdef file to find roles to be installed and ports
/// </summary>
public class ParseConfig
{
public static List<RedisInstance> Parse(string filePath)
{
List<RedisInstance> instances = new List<RedisInstance>();
try
{
XPathDocument csdef = new XPathDocument(filePath);
XPathNavigator csdefNav = csdef.CreateNavigator();
XmlNamespaceManager nsm = new XmlNamespaceManager(csdefNav.NameTable);
nsm.AddNamespace("ns", "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition");
XPathNodeIterator roles = csdefNav.Select("/ns:ServiceDefinition/ns:WorkerRole", nsm);
// first node must be master
bool isMaster = true;
int masterPort = 0;
while (roles.MoveNext())
{
int port = 0;
string localPort = string.Empty;
string extPort = string.Empty;
string roleName = roles.Current.GetAttribute("name", string.Empty);
XPathNodeIterator endpoint = roles.Current.Select("./ns:Endpoints/ns:InputEndpoint", nsm);
if (endpoint.MoveNext())
{
localPort = endpoint.Current.GetAttribute("localPort", string.Empty);
extPort = endpoint.Current.GetAttribute("port", string.Empty);
}
if (roleName != string.Empty && localPort != string.Empty)
{
int.TryParse(localPort, out port);
RedisInstance instance = new RedisInstance();
instance.IsMaster = isMaster;
instance.LocalPort = port;
instance.RoleName = roleName;
if (isMaster)
{
if (int.TryParse(extPort, out port))
masterPort = port;
}
instance.MasterPort = masterPort;
instances.Add(instance);
isMaster = false;
}
}
}
catch (Exception ex)
{
Console.WriteLine("Parsing ServiceDefinition file failed: " + filePath);
if (ex.InnerException != null)
Console.WriteLine(ex.InnerException.Message);
else
Console.WriteLine(ex.Message);
}
return instances;
}
}
}
-514
View File
@@ -1,514 +0,0 @@
#region Copyright Notice
/*
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
#endregion
using Shell32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.Principal;
using System.Text;
namespace RedisInstWA
{
class Program
{
// values from input args
static string GitUrl;
static string LocalExePath;
static bool IsLocal;
static string ConfigFolderPath;
static string RedisConfPath;
static bool IsEmul;
static string Domain;
static string Subscription;
static string passThough;
static bool IsX64;
// Values from environment or configuration
static string WorkPath;
static string RedisInstExePath;
static string PubSettingFilePath;
static List<RedisInstance> Instances;
const string WorkDir = "RedisInstWork";
const string BinariesSubDir = "release";
/// <summary>
/// Prepare and initiate install of Redis to Azure
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
if (!IsElevated)
{
Console.WriteLine("RedisInstWA must be run as an Administrator");
Environment.Exit(1);
}
if (args == null || args.Count() == 0)
{
Console.WriteLine("No parameters were provided\r\n");
Usage();
Environment.Exit(1);
}
else
{
if (!ValidateArgs(args))
{
Console.WriteLine("Usage:");
Usage();
Environment.Exit(1);
}
// create work directory for copying files
string curpath = Directory.GetCurrentDirectory();
WorkPath = Path.Combine(curpath, WorkDir);
if (!FolderHelper.MakeFolder(WorkPath))
{
Console.WriteLine("Failed to make folder for staging the installation");
Environment.Exit(2);
}
RedisInstExePath = Assembly.GetExecutingAssembly().Location;
RedisInstExePath = Path.GetDirectoryName(RedisInstExePath);
// Download and extract exe from zip file or copy local exe
if (!PrepareBinaries(WorkPath))
{
Console.WriteLine("Failed to copy redis executable files to staging directory");
Environment.Exit(2);
}
// Parse the ServiceDefinition to extract roles and ports
if (!ParseConfiguration())
{
Console.WriteLine("Failed to parse the ServiceDefinition file");
Environment.Exit(3);
}
// Prepare instances and xml file for Inst4WA
if (!PrepareInstaller())
{
Console.WriteLine("Failed to create the XML Configuration file for the installer");
Environment.Exit(4);
}
// run Inst4WA to do install
if (!RunInstaller())
{
Console.WriteLine("Failed to execute Inst4WA process to install Redis");
Environment.Exit(5);
}
}
Environment.Exit(0);
}
/// <summary>
/// Validate input parameters
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
private static bool ValidateArgs(string[] args)
{
bool isSource = false;
bool isConfig = false;
bool isRedisConf = false;
bool isEmuOrAzure = false;
passThough = "";
IsX64 = false;
for (int i = 0; i < args.Length; i++)
{
if (args[i].StartsWith("-So", StringComparison.InvariantCultureIgnoreCase))
{
if (i == args.Length - 1)
{
Console.WriteLine("Missing argument after: " + args[i]);
return false;
}
i++;
if (args[i].StartsWith("http", StringComparison.InvariantCultureIgnoreCase))
{
if (Uri.IsWellFormedUriString(args[i], UriKind.Absolute) == false)
{
Console.WriteLine("Source URL format is invalid: " + args[i]);
return false;
}
GitUrl = args[i];
IsLocal = false;
}
else if (!Directory.Exists(args[i]))
{
Console.WriteLine("Source path does not exist: " + args[i]);
return false;
}
else
{
string sourcePath = Path.GetFullPath(args[i]);
string[] files = Directory.GetFiles(sourcePath, "redis-server.exe");
if (files == null || files.Length == 0)
{
Console.WriteLine("Source path does not contain redis-server.exe: " + args[i]);
return false;
}
IsLocal = true;
LocalExePath = sourcePath;
}
isSource = true;
}
else if (args[i].StartsWith("-Co", StringComparison.InvariantCultureIgnoreCase))
{
if (i == args.Length - 1)
{
Console.WriteLine("Missing argument after: " + args[i]);
return false;
}
i++;
if (!Directory.Exists(args[i]))
{
Console.WriteLine("Configuration path does not exist: " + args[i]);
return false;
}
else
{
string configPath = Path.GetFullPath(args[i]);
string[] files = Directory.GetFiles(configPath, "ServiceDefinition.csdef");
if (files == null || files.Length == 0)
{
Console.WriteLine("Configuration path does not contain ServiceDefinition.csdef: " + args[i]);
return false;
}
files = Directory.GetFiles(configPath, "ServiceConfiguration.Local.cscfg");
if (files == null || files.Length == 0)
{
Console.WriteLine("Configuration path does not contain ServiceConfiguration.Local.cscfg: " + args[i]);
return false;
}
files = Directory.GetFiles(configPath, "ServiceConfiguration.Cloud.cscfg");
if (files == null || files.Length == 0)
{
Console.WriteLine("Configuration path does not contain ServiceConfiguration.Cloud.cscfg: " + args[i]);
return false;
}
files = Directory.GetFiles(configPath, "*.publishsettings");
if (files != null && files.Length > 0)
{
// found at least one publishsettings file. Choose first one.
PubSettingFilePath = files[0];
}
else
{
PubSettingFilePath = null;
}
ConfigFolderPath = configPath;
isConfig = true;
}
}
else if (args[i].StartsWith("-Re", StringComparison.InvariantCultureIgnoreCase))
{
if (i == args.Length - 1)
{
Console.WriteLine("Missing argument after: " + args[i]);
return false;
}
i++;
if (!Directory.Exists(args[i]))
{
Console.WriteLine("RedisConf path does not exist: " + args[i]);
return false;
}
else
{
string redisconfPath = Path.GetFullPath(args[i]);
string[] files = Directory.GetFiles(redisconfPath, "redis.conf");
if (files == null || files.Length == 0)
{
Console.WriteLine("RedisConf path does not contain redis.conf: " + args[i]);
return false;
}
RedisConfPath = redisconfPath;
isRedisConf = true;
}
}
else if (args[i].StartsWith("-Em", StringComparison.InvariantCultureIgnoreCase))
{
if (isEmuOrAzure && !IsEmul)
{
Console.WriteLine("Both -Emul and -Domain or -Subscription may not be specified ");
return false;
}
IsEmul = true;
isEmuOrAzure = true;
}
else if (args[i].StartsWith("-Do", StringComparison.InvariantCultureIgnoreCase))
{
if (i == args.Length - 1)
{
Console.WriteLine("Missing argument after: " + args[i]);
return false;
}
i++;
if (isEmuOrAzure && IsEmul)
{
Console.WriteLine("Both -Emul and -Domain may not be specified ");
return false;
}
isEmuOrAzure = true;
IsEmul = false;
Domain = args[i];
}
else if (args[i].StartsWith("-Su", StringComparison.InvariantCultureIgnoreCase))
{
if (i == args.Length - 1)
{
Console.WriteLine("Missing argument after: " + args[i]);
return false;
}
i++;
if (isEmuOrAzure && IsEmul)
{
Console.WriteLine("Both -Emul and -Subscription may not be specified ");
return false;
}
isEmuOrAzure = true;
IsEmul = false;
Subscription = args[i];
}
else if (args[i].StartsWith("--Pa", StringComparison.InvariantCultureIgnoreCase))
{
// Following parameters are passed on to Inst4WA
passThough = " ";
i++;
while (i < args.Length)
{
// put remaining args into a string with space spearator
// If arg doesn't start with -, enclose with quotes
if (args[i].StartsWith("-"))
passThough += args[i] + " ";
else
passThough += @"""" + args[i] + @""" ";
i++;
}
break;
}
else if (args[i].StartsWith("-X64", StringComparison.InvariantCultureIgnoreCase))
{
IsX64 = true;
}
else
{
Console.WriteLine("Unknown option specified " + args[i]);
return false;
}
}
if (!isSource)
{
Console.WriteLine("Missing -Source argument");
return false;
}
if (!isConfig)
{
Console.WriteLine("Missing -Configuration argument");
return false;
}
if (!isRedisConf)
{
Console.WriteLine("Missing -RedisConf argument");
return false;
}
if (!isEmuOrAzure)
{
Console.WriteLine("Missing -Emul or -Domain and -Subscription argument");
return false;
}
if (!IsEmul && String.IsNullOrWhiteSpace(Domain))
{
Console.WriteLine("Missing -Domain argument");
return false;
}
if (!IsEmul && String.IsNullOrWhiteSpace(Subscription))
{
Console.WriteLine("Missing -Subscription argument");
return false;
}
return true;
}
/// <summary>
/// Place installable files in folders
/// </summary>
/// <param name="workPath"></param>
/// <returns></returns>
private static bool PrepareBinaries(string workPath)
{
string WorkBinariesPath = Path.Combine(workPath, BinariesSubDir);
bool isCopied = false;
if (!IsLocal)
{
ExtractZip exz = new ExtractZip();
int rc = exz.DownloadAndExtract(GitUrl, workPath, BinariesSubDir, IsX64);
isCopied = rc == 0;
}
else
{
if (!FolderHelper.MakeFolder(workPath))
return false;
if (LocalExePath != WorkBinariesPath)
{
if (!FolderHelper.MakeFolderReset(WorkBinariesPath))
return false;
Shell sh = new Shell();
Folder outdir = sh.NameSpace(WorkBinariesPath);
IEnumerable<string> subfiles = Directory.EnumerateFiles(LocalExePath, "*.exe");
foreach (string file in subfiles)
{
string filepath = Path.Combine(LocalExePath, file);
outdir.CopyHere(filepath, 0); // 4 for no progress dialog, 16 for Yes to all
}
subfiles = Directory.EnumerateFiles(LocalExePath, "*.pdb");
foreach (string file in subfiles)
{
string filepath = Path.Combine(LocalExePath, file);
outdir.CopyHere(filepath, 0); // 4 for no progress dialog, 16 for Yes to all
}
}
// return true if redis-server exists
isCopied = File.Exists(Path.Combine(WorkBinariesPath, @"redis-server.exe"));
}
if (isCopied)
{
// copy redis.conf file to workPath
string redisconf = File.ReadAllText(Path.Combine(RedisConfPath, @"redis.conf"));
File.WriteAllText(Path.Combine(workPath, @"redis.conf"), redisconf);
}
return isCopied;
}
/// <summary>
/// Parse csdef file to extract installation properties
/// </summary>
/// <returns></returns>
private static bool ParseConfiguration()
{
string pathCsdef = Path.Combine(ConfigFolderPath, "ServiceDefinition.csdef");
Instances = ParseConfig.Parse(pathCsdef);
return Instances.Count > 0;
}
/// <summary>
/// Prepare XML file used as input to Inst4WA
/// </summary>
/// <returns></returns>
private static bool PrepareInstaller()
{
return InstWaXml.CreateInstXml(IsEmul,
ConfigFolderPath,
WorkPath,
WorkPath,
RedisInstExePath,
BinariesSubDir,
Domain,
Subscription,
PubSettingFilePath,
Instances);
}
private static bool RunInstaller()
{
string args = "-XmlConfigPath " + @"""" + Path.Combine(WorkPath, "XmlConfig.xml") + @"""";
if (!IsEmul)
{
// append DomainName and Subscription, enclosing values in quotes
args = args + " -DomainName " + @"""" + Domain + @"""" + " -Subscription " + @"""" + Subscription + @"""";
}
// append passthrough args
args = args + passThough;
// create process info to run inst4wa
Process p = new Process();
p.StartInfo.FileName = Path.Combine(RedisInstExePath, @"Inst4WA\Inst4WA.exe");
p.StartInfo.Arguments = args;
p.StartInfo.UseShellExecute = false;
p.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
Console.WriteLine("Launching " + p.StartInfo.FileName + " " + p.StartInfo.Arguments);
p.Start();
p.WaitForExit();
p.Close();
return true;
}
private static bool IsElevated
{
get
{
return new WindowsPrincipal
(WindowsIdentity.GetCurrent()).IsInRole
(WindowsBuiltInRole.Administrator);
}
}
private static void Usage()
{
string msg = "RedisInstWA installs Redis to Windows Azure.\r\n" +
"RedisInstWA -Source <Github URL to ZIP> | <path to redis-server.exe>\r\n" +
" -Config <path to install configuration>\r\n" +
" -RedisConf <path to redis.conf>\r\n" +
" -Emu | -Domain <Azure domain> -Subscription <Azure subscription>\r\n" +
" [--Pass <other parameters>]\r\n" +
"Where:\r\n" +
"-Source <Github URL to ZIP>: URL to download redis. For example:\r\n" +
" 'https://github.com/MSOpenTech/redis/archive/2.4.zip'\r\n" +
"-Source <path to redis-server.exe>: local path to folder with redis exe files\r\n" +
"-X64: Use this to deploy 64bit binaries. If omitted then 32bit binaries are used\r\n" +
"-Config <path to install configuration>: local path to folder with .csdef file\r\n" +
"-RedisConf <path to redis.conf>: local path to folder with redis.conf file\r\n" +
"-Emu: Use this if deploying to emulator\r\n" +
"-Domain <Azure domain>: Name to be used to create the hosted service in Azure\r\n" +
"-Subscription <Azure subscription>: Windows Azure subscription name (not ID)\r\n" +
"--Pass <other parameters>: Optional. Parameters after --Pass are for Inst4WA\r\n" +
" This can be used to override settings such as Region\r\n" +
"\r\n" +
"Notes:\r\n" +
"Only the first 2 characters of each option are needed (-So is same as -Source)\r\n\r\n" +
"The installer must be run with elevated Administrator privileges\r\n\r\n" +
"Specify one redis.conf for all instances.\r\n" +
" For each instance the port number is appended.\r\n" +
" For each slave, the master endpoint is appended\r\n" +
"\r\n";
Console.WriteLine(msg);
}
}
}
@@ -1,36 +0,0 @@
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("RedisInstWA")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RedisInstWA")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[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("8439504d-6a7f-4c0d-9cfa-52cd74f52da5")]
// 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")]
@@ -1,87 +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>{C8A325BB-0BF9-4A53-941E-3A84C2B27124}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RedisInstWA</RootNamespace>
<AssemblyName>RedisInstWA</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<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' ">
<PlatformTarget>x86</PlatformTarget>
<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="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DownloadHelper.cs" />
<Compile Include="ExtractZip.cs" />
<Compile Include="FolderHelper.cs" />
<Compile Include="InstWaXml.cs" />
<Compile Include="ParseConfig.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RedisInstance.cs" />
</ItemGroup>
<ItemGroup>
<COMReference Include="Shell32">
<Guid>{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.exe" "$(SolutionDir)RedisInstBin"
XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.pdb" "$(SolutionDir)RedisInstBin"
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,41 +0,0 @@
#region Copyright Notice
/*
Copyright © Microsoft Open Technologies, Inc.
All Rights Reserved
Apache 2.0 License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
#endregion
namespace RedisInstWA
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// <summary>
/// Data representing a single Redis instance
/// </summary>
public class RedisInstance
{
public int LocalPort { get; set; }
public bool IsMaster { get; set; }
public int MasterPort { get; set; }
public string RoleName { get; set; }
}
}
-138
View File
@@ -1,138 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
namespace RedisInstWA
{
class Program
{
// values from input args
static string GitUrl;
static string LocalExePath;
static bool IsLocal;
static string ConfigFolderPath;
static string RedisConfPath;
static bool IsEmul;
static string Domain;
static string Subscription;
/// <summary>
/// Prepare and initiate install of Redis to Azure
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
if (!IsElevated || (args == null) || (args.Count() == 0))
{
Usage();
}
else
{
if (!ValidateArgs(args))
{
Usage();
Environment.Exit(1);
}
// Download and extract exe from zip file or copy local exe
PrepareBinaries();
// Prepare instances and xml file for Inst4WA
PrepareInstaller();
// run Inst4WA to do install
RunInstaller();
}
}
private static bool ValidateArgs(string[] args)
{
for (int i = 0; i < args.Length; i++)
{
if (args[i].StartsWith("-So", StringComparison.InvariantCultureIgnoreCase))
{
i++;
if (args[i].StartsWith("-", StringComparison.InvariantCultureIgnoreCase))
{
Console.WriteLine("Source url or path not valid " + args[i]);
return false;
}
if (args[i].StartsWith("http", StringComparison.InvariantCultureIgnoreCase))
{
}
}
else if (args[i].StartsWith("-Co", StringComparison.InvariantCultureIgnoreCase))
{
i++;
}
else if (args[i].StartsWith("-Re", StringComparison.InvariantCultureIgnoreCase))
{
i++;
}
else if (args[i].StartsWith("-Em", StringComparison.InvariantCultureIgnoreCase))
{
}
else if (args[i].StartsWith("-Do", StringComparison.InvariantCultureIgnoreCase))
{
i++;
}
else if (args[i].StartsWith("-Su", StringComparison.InvariantCultureIgnoreCase))
{
i++;
}
else
{
Console.WriteLine("Unknown option specified " + args[i]);
return false;
}
}
}
private static void PrepareBinaries()
{
}
private static void PrepareInstaller()
{
}
private static void RunInstaller()
{
}
private static bool IsElevated
{
get
{
return new WindowsPrincipal
(WindowsIdentity.GetCurrent()).IsInRole
(WindowsBuiltInRole.Administrator);
}
}
private static void Usage()
{
string msg = "RedisInstWA installs Redis to Windows Azure.\r\n" +
"RedisInstWA -Source <Github URL to ZIP> | <path to redis-server.exe>\r\n" +
" -Config <path to install configuration>\r\n" +
" -RedisConf <path to redis.conf>\r\n" +
" -Emu | -Domain <Azure domain> -Subscription <Azure subscription>\r\n" +
"Where:\r\n" +
"<Github URL to ZIP>: URL to download such as 'https://github.com/MSOpenTech/redis/archive/2.4.zip'\r\n" +
"<path to redis-server.exe>: local path to redis executables to deploy\r\n" +
"<path to install configuration>: local path to .csdef file specifying Master and Slave roles\r\n" +
"-Emu: Use this if deploying to emulator\r\n" +
"<Azure domain>: Unique name to be used to create the service to be deployed\r\n" +
"<Azure subscription>: Windows Azure subscription name\r\n" +
"\r\n" +
"Notes:\r\n" +
"Only the first 2 characters of each option are needed (-So is same as -Source)\r\n" +
"The installer must be run with elevated Administrator privileges\r\n" +
"Specify one redis.conf for all instances.\r\n" +
" For each instance the port number is appended. For each slave, the master endpoint is appended\r\n" +
"\r\n";
Console.WriteLine(msg);
}
}
}
@@ -1,36 +0,0 @@
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("RedisMaster")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("RedisMaster")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
[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("453cf019-2835-414d-ba76-dc036b86aa9e")]
// 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")]
@@ -1,129 +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)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8724EBEA-6875-4BCD-A538-30428EDABF27}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RedisServer</RootNamespace>
<AssemblyName>RedisServer</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RoleType>Worker</RoleType>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\RamWorks\WindowsAzure2\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\ref\Microsoft.WindowsAzure.Diagnostics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\ref\Microsoft.WindowsAzure.ServiceRuntime.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WorkerRole.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="startup.cmd">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.dll" "$(SolutionDir)RedisInstBin\RedisPkgBin"
XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.xml" "$(SolutionDir)RedisInstBin\RedisPkgBin"
XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)*.pdb" "$(SolutionDir)RedisInstBin\RedisPkgBin"
XCOPY /Y/I/Q "$(ProjectDir)$(OutDir)startup.cmd" "$(SolutionDir)RedisInstBin\RedisPkgBin"
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,88 +0,0 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Threading;
using Microsoft.WindowsAzure.ServiceRuntime;
namespace RedisServer
{
public class WorkerRole : RoleEntryPoint
{
public override void Run()
{
Trace.WriteLine("Redis Server entry point called", "Information");
while (true)
{
Thread.Sleep(10000);
Trace.WriteLine("Working", "Information");
}
}
public override bool OnStart()
{
// Set the maximum number of concurrent connections
ServicePointManager.DefaultConnectionLimit = 12;
RedisStart();
return base.OnStart();
}
private void RedisStart()
{
string redisConfig = "redis.conf";
string redisServer = "release\\redis-server.exe";
string cmdLine = String.Format("{0} {1}", redisServer, redisConfig);
ExecuteShellCommand(cmdLine, false);
}
private Process ExecuteShellCommand(String command, bool waitForExit, String workingDir = null)
{
Process processToExecuteCommand = new Process();
processToExecuteCommand.StartInfo.FileName = "cmd.exe";
if (workingDir != null)
{
processToExecuteCommand.StartInfo.WorkingDirectory = workingDir;
}
processToExecuteCommand.StartInfo.Arguments = @"/C " + command;
processToExecuteCommand.StartInfo.RedirectStandardInput = true;
processToExecuteCommand.StartInfo.RedirectStandardError = true;
processToExecuteCommand.StartInfo.RedirectStandardOutput = true;
processToExecuteCommand.StartInfo.UseShellExecute = false;
processToExecuteCommand.StartInfo.CreateNoWindow = true;
processToExecuteCommand.EnableRaisingEvents = false;
processToExecuteCommand.OutputDataReceived += new DataReceivedEventHandler(processToExecuteCommand_OutputDataReceived);
processToExecuteCommand.ErrorDataReceived += new DataReceivedEventHandler(processToExecuteCommand_ErrorDataReceived);
processToExecuteCommand.Start();
processToExecuteCommand.BeginOutputReadLine();
processToExecuteCommand.BeginErrorReadLine();
if (waitForExit == true)
{
processToExecuteCommand.WaitForExit();
processToExecuteCommand.Close();
processToExecuteCommand.Dispose();
processToExecuteCommand = null;
}
return processToExecuteCommand;
}
private void processToExecuteCommand_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
Trace.WriteLine(e.Data, "Information");
}
private void processToExecuteCommand_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
Trace.WriteLine(e.Data, "Information");
}
}
}
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
</configuration>
@@ -1,2 +0,0 @@
@echo off
netsh advfirewall firewall add rule name="redis" dir=in action=allow enable=yes program="release\\redis-server.exe"
-54
View File
@@ -1,54 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedisDeployCmdlets", "RedisDeployCmdlets\RedisDeployCmdlets.csproj", "{2F9BEF35-EB38-41C1-9A2E-136702720EE9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedisServer", "RedisServer\RedisServer.csproj", "{8724EBEA-6875-4BCD-A538-30428EDABF27}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedisInstWA", "RedisInstWA\RedisInstWA.csproj", "{C8A325BB-0BF9-4A53-941E-3A84C2B27124}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Debug|x86.ActiveCfg = Debug|Any CPU
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Release|Any CPU.Build.0 = Release|Any CPU
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2F9BEF35-EB38-41C1-9A2E-136702720EE9}.Release|x86.ActiveCfg = Release|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Debug|x86.ActiveCfg = Debug|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Release|Any CPU.Build.0 = Release|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8724EBEA-6875-4BCD-A538-30428EDABF27}.Release|x86.ActiveCfg = Release|Any CPU
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Debug|Any CPU.ActiveCfg = Debug|x86
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Debug|Mixed Platforms.Build.0 = Debug|x86
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Debug|x86.ActiveCfg = Debug|x86
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Debug|x86.Build.0 = Debug|x86
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Release|Any CPU.ActiveCfg = Release|x86
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Release|Mixed Platforms.ActiveCfg = Release|x86
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Release|Mixed Platforms.Build.0 = Release|x86
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Release|x86.ActiveCfg = Release|x86
{C8A325BB-0BF9-4A53-941E-3A84C2B27124}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
-16
View File
@@ -1,16 +0,0 @@
This solution contains projects for building MSI installer for 32 bit Redis and 64 bit Redis.
The actual binaries to be included in the MSI must be placed in subfolders before building the projects.
Place binaries for the 32 bit Redis installer in folder 'x32'.
Place binaries for the 64 bit Redis installer in folder 'x64'.
The files that should be placed in each of these folders are:
redis-server.exe
redis-cli.exe
redis-check-aof.exe
redis-check-dump.exe
redis.conf
RedisWatcher.exe
RedisWatcher.man
watcher.conf
-154
View File
@@ -1,154 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>
<Product Id="C59F90B2-53D1-411E-B519-6519A9B65F5A" Name="Redis 32 bit" Language="1033" Version="2.6.12.0"
Manufacturer="Microsoft Open Technologies, Inc." UpgradeCode="702edf5c-2ecf-4239-ad8d-1cf07ab6e6f2">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<PropertyRef Id="WIX_ACCOUNT_USERS" />
<PropertyRef Id="WIX_ACCOUNT_ADMINISTRATORS"/>
<UIRef Id="WixUI_InstallDirCust"/>
<Feature Id="RedisFeature" Title="Redis" Level="1">
<ComponentGroupRef Id="RedisComponents" />
</Feature>
<Feature Id="WatcherFeature" Title="Redis Watcher" Level="1">
<ComponentGroupRef Id="WatcherComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Redis" >
<Directory Id="WATCHERFOLDER" Name="Watcher" />
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="RedisComponents" Directory="INSTALLFOLDER">
<Component Id="Server" Guid="36D940AC-AF8F-4AD3-84A4-9A1420532B8F" Win64="no">
<File Id="redisserver.exe" Name="redis-server.exe" Source="x32\redis-server.exe" DiskId="1" KeyPath="yes" />
</Component>
<Component Id="Client" Guid="AC24EFC4-585E-45BC-946E-7C365C528304" Win64="no">
<File Id="rediscli.exe" Name="redis-cli.exe" Source="x32\redis-cli.exe" DiskId="1" KeyPath="yes" />
</Component>
<Component Id="CheckAof" Guid="2684E8FB-824F-4C47-9707-318AA6844D28" Win64="no">
<File Id="redischeckaof.exe" Name="redis-check-aof.exe" Source="x32\redis-check-aof.exe" DiskId="1" KeyPath="yes" />
</Component>
<Component Id="CheckDump" Guid="0D04E223-5377-4DAC-A0D3-48F61D909DF5" Win64="no">
<File Id="redischeckdump.exe" Name="redis-check-dump.exe" Source="x32\redis-check-dump.exe" DiskId="1" KeyPath="yes" />
</Component>
<Component Id="RedisConf" Guid="" Win64="no">
<File Id="redisconf.exe" Name="redis.conf" Source="x32\redis.conf" DiskId="1" KeyPath="yes">
<Permission GenericAll="yes" GenericWrite="yes" User="[WIX_ACCOUNT_USERS]" />
<Permission GenericAll="yes" User="[WIX_ACCOUNT_ADMINISTRATORS]" />
</File>
</Component>
</ComponentGroup>
<ComponentGroup Id="WatcherComponents" Directory="WATCHERFOLDER">
<Component Id="rediswatcher" Guid="14AC69FD-F819-4A0E-B89B-FF6631A49E21" Win64="no">
<File Id="rediswatcher.exe" Name="rediswatcher.exe" Source="x32\rediswatcher.exe" DiskId="1" KeyPath="yes" />
<File Id="RedisWatcher.man" Name="RedisWatcher.man" Source="x32\rediswatcher.man" DiskId="1" >
<util:EventManifest MessageFile="[WATCHERFOLDER]RedisWatcher.exe" ResourceFile="[WATCHERFOLDER]RedisWatcher.exe"/>
</File>
<File Id="watcher.conf" Name="watcher.conf" Source="x32\watcher.conf" DiskId="1" >
<Permission GenericAll="yes" GenericWrite="yes" User="[WIX_ACCOUNT_USERS]" />
<Permission GenericAll="yes" User="[WIX_ACCOUNT_ADMINISTRATORS]" />
</File>
<ServiceInstall Id="RedisWatcherSvc" Name="RedisWatcherSvc" DisplayName ="Redis watcher" ErrorControl="normal"
Start="auto" Type="ownProcess" Description="Redis process starter and watchdog">
</ServiceInstall>
<ServiceControl Id="SvcControl" Name="RedisWatcherSvc" Remove="uninstall" Stop="both" Wait="no" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<UI Id="WixUI_InstallDirCust">
<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="InstallDirCust" />
<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="InstallDirOptDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="InstallDirOptDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="InstallDirOptDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirOptDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallDirOptDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="InstallDirOptDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallDirOptDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirOptDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirOptDlg" 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>
<Fragment>
<UI>
<Dialog Id="InstallDirOptDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="AddLocal" Value="ALL" Order="1">1</Publish>
<Publish Event="Remove" Value="WatcherFeature" Order="2"><![CDATA[WIXUI_InstallWatcher<>"1"]]></Publish>
</Control>
<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="!(loc.InstallDirDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
<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="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" />
<Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
<Control Id="InstallWatcherCheckBox" Type="CheckBox" X="20" Y="160" Width="226" Height="18" CheckBoxValue="1" Property="WIXUI_InstallWatcher" Text="Install Redis Watcher service?" Integer="yes" />
</Dialog>
</UI>
</Fragment>
</Wix>
-158
View File
@@ -1,158 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>
<Product Id="C48F2197-3D55-4F88-B4DD-530687C485F0" Name="Redis 64 bit" Language="1033" Version="2.6.12.0"
Manufacturer="Microsoft Open Technologies, Inc." UpgradeCode="2B4801F5-22D8-430C-88B9-A9218E38E3E9">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<PropertyRef Id="WIX_ACCOUNT_USERS" />
<PropertyRef Id="WIX_ACCOUNT_ADMINISTRATORS"/>
<UIRef Id="WixUI_InstallDirCust"/>
<Feature Id="RedisFeature" Title="Redis" Level="1">
<ComponentGroupRef Id="RedisComponents" />
</Feature>
<Feature Id="WatcherFeature" Title="Redis Watcher" Level="1">
<ComponentGroupRef Id="WatcherComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="Redis" >
</Directory>
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER32" Name="Redis" >
<Directory Id="WATCHERFOLDER" Name="Watcher" />
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="RedisComponents" Directory="INSTALLFOLDER">
<Component Id="Server" Guid="E3150BEC-9C78-48C4-AC4B-49766B5A431A" Win64="yes">
<File Id="redisserver.exe" Name="redis-server.exe" Source="x64\redis-server.exe" DiskId="1" KeyPath="yes" />
</Component>
<Component Id="Client" Guid="B6D378B9-30E6-4367-915B-208FA67F06BC" Win64="yes">
<File Id="rediscli.exe" Name="redis-cli.exe" Source="x64\redis-cli.exe" DiskId="1" KeyPath="yes" />
</Component>
<Component Id="CheckAof" Guid="4A115146-E7FE-486D-9CB6-6CE4CC41DB21" Win64="yes">
<File Id="redischeckaof.exe" Name="redis-check-aof.exe" Source="x64\redis-check-aof.exe" DiskId="1" KeyPath="yes" />
</Component>
<Component Id="CheckDump" Guid="2CBDE2A2-4297-4CBE-99E8-0B598D06447B" Win64="yes">
<File Id="redischeckdump.exe" Name="redis-check-dump.exe" Source="x64\redis-check-dump.exe" DiskId="1" KeyPath="yes" />
</Component>
<Component Id="RedisConf" Guid="" Win64="yes">
<File Id="redisconf.exe" Name="redis.conf" Source="x64\redis.conf" DiskId="1" KeyPath="yes">
<Permission GenericAll="yes" GenericWrite="yes" User="[WIX_ACCOUNT_USERS]" />
<Permission GenericAll="yes" User="[WIX_ACCOUNT_ADMINISTRATORS]" />
</File>
</Component>
</ComponentGroup>
<ComponentGroup Id="WatcherComponents" Directory="WATCHERFOLDER">
<Component Id="rediswatcher" Guid="F85C1F89-3329-400B-9ACF-084CD31BC577" Win64="no">
<File Id="rediswatcher.exe" Name="rediswatcher.exe" Source="x64\rediswatcher.exe" DiskId="1" KeyPath="yes" />
<File Id="RedisWatcher.man" Name="RedisWatcher.man" Source="x64\rediswatcher.man" DiskId="1" >
<util:EventManifest MessageFile="[WATCHERFOLDER]RedisWatcher.exe" ResourceFile="[WATCHERFOLDER]RedisWatcher.exe"/>
</File>
<File Id="watcher.conf" Name="watcher.conf" Source="x64\watcher.conf" DiskId="1" >
<Permission GenericAll="yes" GenericWrite="yes" User="[WIX_ACCOUNT_USERS]" />
<Permission GenericAll="yes" User="[WIX_ACCOUNT_ADMINISTRATORS]" />
</File>
<ServiceInstall Id="RedisWatcherSvc" Name="RedisWatcherSvc" DisplayName ="Redis watcher" ErrorControl="normal"
Start="auto" Type="ownProcess" Description="Redis process starter and watchdog">
</ServiceInstall>
<ServiceControl Id="SvcControl" Name="RedisWatcherSvc" Remove="uninstall" Stop="both" Wait="no" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<UI Id="WixUI_InstallDirCust">
<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="InstallDirCust" />
<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="InstallDirOptDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="InstallDirOptDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="InstallDirOptDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirOptDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallDirOptDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="InstallDirOptDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallDirOptDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirOptDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirOptDlg" 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>
<Fragment>
<UI>
<Dialog Id="InstallDirOptDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="AddLocal" Value="ALL" Order="1">1</Publish>
<Publish Event="Remove" Value="WatcherFeature" Order="2"><![CDATA[WIXUI_InstallWatcher<>"1"]]></Publish>
</Control>
<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="!(loc.InstallDirDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
<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="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" />
<Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
<Control Id="InstallWatcherCheckBox" Type="CheckBox" X="20" Y="160" Width="226" Height="18" CheckBoxValue="1" Property="WIXUI_InstallWatcher" Text="Install Redis Watcher service?" Integer="yes" />
</Dialog>
</UI>
</Fragment>
</Wix>
-39
View File
@@ -1,39 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "RedisInstall32", "RedisInstall32.wixproj", "{1A7F424E-5966-45C9-A96D-D77E5CC25F50}"
EndProject
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "RedisInstall64", "RedisInstall64.wixproj", "{39F87998-996A-4EAA-B3A4-BC12C2C80EFA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B7790A41-1B9D-4758-9290-21B1FE13BD01}"
ProjectSection(SolutionItems) = preProject
ReadMe.txt = ReadMe.txt
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1A7F424E-5966-45C9-A96D-D77E5CC25F50}.Debug|x64.ActiveCfg = Debug|x86
{1A7F424E-5966-45C9-A96D-D77E5CC25F50}.Debug|x86.ActiveCfg = Debug|x86
{1A7F424E-5966-45C9-A96D-D77E5CC25F50}.Debug|x86.Build.0 = Debug|x86
{1A7F424E-5966-45C9-A96D-D77E5CC25F50}.Release|x64.ActiveCfg = Release|x86
{1A7F424E-5966-45C9-A96D-D77E5CC25F50}.Release|x86.ActiveCfg = Release|x86
{1A7F424E-5966-45C9-A96D-D77E5CC25F50}.Release|x86.Build.0 = Release|x86
{39F87998-996A-4EAA-B3A4-BC12C2C80EFA}.Debug|x64.ActiveCfg = Debug|x64
{39F87998-996A-4EAA-B3A4-BC12C2C80EFA}.Debug|x64.Build.0 = Debug|x64
{39F87998-996A-4EAA-B3A4-BC12C2C80EFA}.Debug|x86.ActiveCfg = Debug|x64
{39F87998-996A-4EAA-B3A4-BC12C2C80EFA}.Debug|x86.Build.0 = Debug|x86
{39F87998-996A-4EAA-B3A4-BC12C2C80EFA}.Release|x64.ActiveCfg = Release|x64
{39F87998-996A-4EAA-B3A4-BC12C2C80EFA}.Release|x64.Build.0 = Release|x64
{39F87998-996A-4EAA-B3A4-BC12C2C80EFA}.Release|x86.ActiveCfg = Release|x64
{39F87998-996A-4EAA-B3A4-BC12C2C80EFA}.Release|x86.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
-46
View File
@@ -1,46 +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>3.7</ProductVersion>
<ProjectGuid>{1a7f424e-5966-45c9-a96d-d77e5cc25f50}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>RedisInstall32</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<Name>RedisInstall32</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="Redis32.wxs" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
-54
View File
@@ -1,54 +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>3.7</ProductVersion>
<ProjectGuid>{39f87998-996a-4eaa-b3a4-bc12c2c80efa}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>RedisInstall64</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>Debug</DefineConstants>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="Redis64.wxs" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>