Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bd15ae5d5 | ||
|
|
078e60943c | ||
|
|
a4ec693a60 | ||
|
|
7fe150b608 | ||
|
|
24f851bb4a | ||
|
|
39c2cbd5d2 | ||
|
|
3f0d60a979 | ||
|
|
9c7fec6c8f | ||
|
|
ded604c192 | ||
|
|
4890508935 | ||
|
|
59df7b9719 | ||
|
|
bc2b5300e5 | ||
|
|
7c010bf434 | ||
|
|
1f51d43e2c | ||
|
|
822e73360f | ||
|
|
ecad5be188 | ||
|
|
4769b389a6 | ||
|
|
9c21471fb2 | ||
|
|
8b46cde11e | ||
|
|
788969aa2c | ||
|
|
9662f82c18 | ||
|
|
c8a8d47f45 |
23
README.md
23
README.md
@@ -122,13 +122,16 @@ Alternatively you can use the Services Control Panel.
|
||||
TimberWinR.ServiceHost.exe [options]
|
||||
|
||||
Options:
|
||||
-logDir: Specifies the directory where TimberWinR will write its log file TimberWinR.txt
|
||||
Default is -logDir:"C:\logs"
|
||||
-logLevel: Specifies the logging level for TimberWinR
|
||||
Legal Values: Trace|Debug|Info|Warn|Error|Fatal|Off
|
||||
Default is -logDir:Info
|
||||
-configFile: Specifies the path to the JSON config file, or directory which contains .json file(s).
|
||||
Default is -configFile:default.json
|
||||
-logDir: Specifies the directory where TimberWinR will write its log file TimberWinR.txt
|
||||
Default is -logDir:"C:\logs"
|
||||
-logLevel: Specifies the logging level for TimberWinR
|
||||
Legal Values: Trace|Debug|Info|Warn|Error|Fatal|Off
|
||||
Default is -logDir:Info
|
||||
-configFile: Specifies the path to the JSON config file, or directory which contains .json file(s).
|
||||
Default is -configFile:default.json
|
||||
-diagnosticPort: Specifies the diagnostic port which can be used to get a health check of the service.
|
||||
Default Port is 5142, A value of 0 will disable it. Open a browser
|
||||
http://localhost:5142
|
||||
```
|
||||
#### -configFile
|
||||
This may be a single .json file or a directory containing .json file(s). If it is a directory, all
|
||||
@@ -156,7 +159,7 @@ TimberWinR.ServiceHost.exe install --autostart
|
||||
TimberWinR.ServiceHost.exe start
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
### Builds ###
|
||||
Builds are here.
|
||||
Soon
|
||||
|
||||
|
||||
3
TimberWinR.Builds/Readme.txt
Normal file
3
TimberWinR.Builds/Readme.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
.MSI Packages Here
|
||||
------------------
|
||||
|
||||
@@ -21,6 +21,9 @@ namespace TimberWinR.ServiceHost
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
const string KeyPath = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TimberWinR";
|
||||
const string KeyName = "ImagePath";
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
Arguments arguments = new Arguments();
|
||||
@@ -50,11 +53,8 @@ namespace TimberWinR.ServiceHost
|
||||
hostConfigurator.SetServiceName("TimberWinR");
|
||||
|
||||
hostConfigurator.AfterInstall(() =>
|
||||
{
|
||||
const string keyPath = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TimberWinR";
|
||||
const string keyName = "ImagePath";
|
||||
|
||||
var currentValue = Registry.GetValue(keyPath, keyName, "").ToString();
|
||||
{
|
||||
var currentValue = Registry.GetValue(KeyPath, KeyName, "").ToString();
|
||||
if (!string.IsNullOrEmpty(currentValue))
|
||||
{
|
||||
AddServiceParameter("-configFile", arguments.ConfigFile);
|
||||
@@ -69,29 +69,25 @@ namespace TimberWinR.ServiceHost
|
||||
|
||||
private static void AddServiceParameter(string paramName, string value)
|
||||
{
|
||||
string keyPath = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TimberWinR";
|
||||
string keyName = "ImagePath";
|
||||
|
||||
string currentValue = Registry.GetValue(keyPath, keyName, "").ToString();
|
||||
|
||||
string currentValue = Registry.GetValue(KeyPath, KeyName, "").ToString();
|
||||
|
||||
if (!string.IsNullOrEmpty(paramName) && !currentValue.Contains(string.Format("{0} ", paramName)))
|
||||
{
|
||||
currentValue += string.Format(" {0} \"{1}\"", paramName, value.Replace("\\\\", "\\"));
|
||||
Registry.SetValue(keyPath, keyName, currentValue);
|
||||
Registry.SetValue(KeyPath, KeyName, currentValue);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddServiceParameter(string paramName, int value)
|
||||
{
|
||||
string keyPath = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TimberWinR";
|
||||
string keyName = "ImagePath";
|
||||
|
||||
string currentValue = Registry.GetValue(keyPath, keyName, "").ToString();
|
||||
|
||||
string currentValue = Registry.GetValue(KeyPath, KeyName, "").ToString();
|
||||
|
||||
if (!string.IsNullOrEmpty(paramName) && !currentValue.Contains(string.Format("{0}:", paramName)))
|
||||
{
|
||||
currentValue += string.Format(" {0}:{1}", paramName, value);
|
||||
Registry.SetValue(keyPath, keyName, currentValue);
|
||||
Registry.SetValue(KeyPath, KeyName, currentValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,10 @@ EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1B2F600B-2400-45B9-A28E-CFC391D9EFA9}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
appveyor.yml = appveyor.yml
|
||||
tools\chocolateyInstall.ps1.template = tools\chocolateyInstall.ps1.template
|
||||
LICENSE.txt = LICENSE.txt
|
||||
README.md = README.md
|
||||
timberwinr.nuspec.template = timberwinr.nuspec.template
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "TimberWinR.Wix", "TimberWix\TimberWinR.Wix.wixproj", "{82A39B31-61EC-468D-AA71-0D949AC6528F}"
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace TimberWinR.Diagnostics
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.GetCurrentClassLogger().Error("Tcp Exception", ex);
|
||||
LogManager.GetCurrentClassLogger().Error(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace TimberWinR.Inputs
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.GetCurrentClassLogger().Error("Error Deleting Checkpoint File", ex);
|
||||
LogManager.GetCurrentClassLogger().Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace TimberWinR.Inputs
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.GetCurrentClassLogger().Error("Tcp Exception", ex);
|
||||
LogManager.GetCurrentClassLogger().Error(ex);
|
||||
}
|
||||
|
||||
if (clientStream != null)
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace TimberWinR.Inputs
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.GetCurrentClassLogger().Error("WindowsEventListener", ex);
|
||||
LogManager.GetCurrentClassLogger().Error(ex);
|
||||
firstQuery = true;
|
||||
oLogQuery = new LogQuery();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<Property Id="LOGDIR">c:\logs</Property>
|
||||
<Property Id="LOGLEVEL">Info</Property>
|
||||
<Property Id="DIAGPORT">5141</Property>
|
||||
<UIRef Id="WixUI_InstallDir" />
|
||||
|
||||
<!--
|
||||
We need to be able to uninstall a newer version from an older version.
|
||||
The default reinstallmode is "omus", of which the 'o' means "reinstall if missing or older"
|
||||
@@ -30,15 +32,19 @@
|
||||
<Directory Id="INSTALLFOLDER" Name="TimberWinR" />
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
||||
|
||||
</Fragment>
|
||||
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
|
||||
<Component Id="ProductComponent" Guid="1BDEC5F3-5E9F-4E2E-8B1B-30E7968A99E1">
|
||||
<File Id="TimberWinR.ServiceHost.exe" Name="$(var.TimberWinR.ServiceHost.TargetFileName)" Source="$(var.TimberWinR.ServiceHost.TargetPath)" />
|
||||
<File Id="TimberWinR.ServiceHost.exe" Name="$(var.TimberWinR.ServiceHost.TargetFileName)" Source="$(var.TimberWinR.ServiceHost.TargetPath)" />
|
||||
<File Id="TimberWinR.ServiceHost.exe.config" Source="$(var.TimberWinR.ServiceHost.TargetDir)\TimberWinR.ServiceHost.exe.config" />
|
||||
<File Id="Interop.MSUtil.dll" Source="$(var.TimberWinR.ServiceHost.TargetDir)\Interop.MSUtil.dll" />
|
||||
<File Id="csredis.dll" Source="$(var.TimberWinR.ServiceHost.TargetDir)\csredis.dll" />
|
||||
<File Id="default.json" Source="$(var.TimberWinR.ServiceHost.TargetDir)\default.json" />
|
||||
<File Id="Newtonsoft.Json.dll" Source="$(var.TimberWinR.ServiceHost.TargetDir)\Newtonsoft.Json.dll" />
|
||||
<File Id="Nlog.dll" Source="$(var.TimberWinR.ServiceHost.TargetDir)\Nlog.dll" />
|
||||
<File Id="RestSharp.dll" Source="$(var.TimberWinR.ServiceHost.TargetDir)\RestSharp.dll" />
|
||||
|
||||
@@ -44,6 +44,12 @@
|
||||
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WixExtension Include="WixUIExtension">
|
||||
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
|
||||
<Name>WixUIExtension</Name>
|
||||
</WixExtension>
|
||||
</ItemGroup>
|
||||
<Import Project="$(WixTargetsPath)" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent />
|
||||
|
||||
@@ -12,3 +12,4 @@ assembly_info:
|
||||
|
||||
artifacts:
|
||||
- path: '**\*.msi'
|
||||
|
||||
|
||||
27
timberwinr.nuspec.template
Normal file
27
timberwinr.nuspec.template
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Do not remove this test for UTF-8: if ??? doesn?t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages -->
|
||||
<id>TimberWinR</id>
|
||||
<title>TimberWinR</title>
|
||||
<version>${version}.0</version>
|
||||
<authors>efontana</authors>
|
||||
<owners>Eric Fontana</owners>
|
||||
<summary>TimberWinR Shipper</summary>
|
||||
<description>TimberWinR Shipper</description>
|
||||
<projectUrl>https://github.com/efontana/TimberWinR</projectUrl>
|
||||
<tags>TimberWinR admin</tags>
|
||||
<copyright></copyright>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<!--<iconUrl>http://cdn.rawgit.com/__CHOCO_PKG_MAINTAINER_REPO__/master/icons/TimberWinR.png</iconUrl>-->
|
||||
<!--<dependencies>
|
||||
<dependency id="" version="" />
|
||||
</dependencies>-->
|
||||
<releaseNotes></releaseNotes>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="tools\**" target="tools" />
|
||||
</files>
|
||||
</package>
|
||||
46
tools/chocolateyInstall.ps1.template
Normal file
46
tools/chocolateyInstall.ps1.template
Normal file
@@ -0,0 +1,46 @@
|
||||
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one
|
||||
|
||||
$packageName = 'TimberWinR' # arbitrary name for the package, used in messages
|
||||
$installerType = 'msi' #only one of these: exe, msi, msu
|
||||
$url = 'http://www.ericfontana.com/TimberWinR/TimberWinR-${version}.0.msi' # download url
|
||||
$silentArgs = '/quiet' # "/s /S /q /Q /quiet /silent /SILENT /VERYSILENT" # try any of these to get the silent installer #msi is always /quiet
|
||||
$validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx
|
||||
|
||||
# main helpers - these have error handling tucked into them already
|
||||
# installer, will assert administrative rights
|
||||
|
||||
# if removing $url64, please remove from here
|
||||
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes
|
||||
# download and unpack a zip file
|
||||
|
||||
#try { #error handling is only necessary if you need to do anything in addition to/instead of the main helpers
|
||||
# other helpers - using any of these means you want to uncomment the error handling up top and at bottom.
|
||||
# downloader that the main helpers use to download items
|
||||
|
||||
# if removing $url64, please remove from here
|
||||
#Get-ChocolateyWebFile "$packageName" 'DOWNLOAD_TO_FILE_FULL_PATH' "$url" "$url64"
|
||||
# installer, will assert administrative rights - used by Install-ChocolateyPackage
|
||||
#Install-ChocolateyInstallPackage "$packageName" "$installerType" "$silentArgs" '_FULLFILEPATH_' -validExitCodes $validExitCodes
|
||||
# unzips a file to the specified location - auto overwrites existing content
|
||||
#Get-ChocolateyUnzip "FULL_LOCATION_TO_ZIP.zip" "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
|
||||
# Runs processes asserting UAC, will assert administrative rights - used by Install-ChocolateyInstallPackage
|
||||
#Start-ChocolateyProcessAsAdmin 'STATEMENTS_TO_RUN' 'Optional_Application_If_Not_PowerShell' -validExitCodes $validExitCodes
|
||||
# add specific folders to the path - any executables found in the chocolatey package folder will already be on the path. This is used in addition to that or for cases when a native installer doesn't add things to the path.
|
||||
#Install-ChocolateyPath 'LOCATION_TO_ADD_TO_PATH' 'User_OR_Machine' # Machine will assert administrative rights
|
||||
# add specific files as shortcuts to the desktop
|
||||
#$target = Join-Path $MyInvocation.MyCommand.Definition "$($packageName).exe"
|
||||
#Install-ChocolateyDesktopLink $target
|
||||
|
||||
#------- ADDITIONAL SETUP -------#
|
||||
# make sure to uncomment the error handling if you have additional setup to do
|
||||
|
||||
# outputs the bitness of the OS (either "32" or "64")
|
||||
#$osBitness = Get-ProcessorBits
|
||||
|
||||
|
||||
# the following is all part of error handling
|
||||
#Write-ChocolateySuccess "$packageName"
|
||||
#} catch {
|
||||
#Write-ChocolateyFailure "$packageName" "$($_.Exception.Message)"
|
||||
#throw
|
||||
#}
|
||||
Reference in New Issue
Block a user