Skip to content

Commit

Permalink
Version.dat file updated.
Browse files Browse the repository at this point in the history
Bat files that install/uninstall the Updater service.
Release 20170813
  • Loading branch information
Francisco Santos committed Aug 13, 2017
1 parent de7c1b2 commit 1ec6d67
Show file tree
Hide file tree
Showing 59 changed files with 82,600 additions and 37 deletions.
2 changes: 1 addition & 1 deletion NetworkGameCopier/DownloadTaskQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private DownloadTaskQueue()

private void ShutdownComputer()
{
var psi = new ProcessStartInfo("shutdown", "/s /t 0")
var psi = new ProcessStartInfo("shutdown", "/s /t 60")
{
CreateNoWindow = true,
UseShellExecute = false
Expand Down
16 changes: 0 additions & 16 deletions NetworkGameCopier/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,6 @@ private void LaunchUpdater()
service.Start();
}

// This function is outdated, it will be deleted as soon as it has 0 value.
public void RegisterUpdateService()
{
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
#if DEBUG
startInfo.Arguments = @"/C ..\..\..\UpdateService\bin\Debug\UpdateService.exe -install";
#else
startInfo.Arguments = "/C UpdateService.exe -install";
#endif
process.StartInfo = startInfo;
process.Start();
}


private void Init()
{
Expand Down
2 changes: 1 addition & 1 deletion NetworkGameCopier/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion NetworkGameCopier/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<value>5</value>
</data>
<data name="VersionNumber" xml:space="preserve">
<value>20170808</value>
<value>20170813</value>
<comment>Version Number. Increase to indicate an update.</comment>
</data>
</root>
18 changes: 16 additions & 2 deletions NetworkGameCopier/SettingsManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
Expand Down Expand Up @@ -44,8 +45,8 @@ private SettingsManager()
// Fresh start!
LogManager.GetCurrentClassLogger().Info("Fresh start! " + e.Message);
LoadDefaultValues();
RegisterUpdateService();
RegistryManager.WriteExecutionLocation();
//MainWindow.RegisterUpdateService();
new Thread(ForceSave).Start();
new Thread(() =>
{
Expand Down Expand Up @@ -146,7 +147,20 @@ public void ForceSave()
_isIoNeeded = false;
}


private void RegisterUpdateService()
{
#if DEBUG
return;
#endif
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/C InstallService.bat";
process.StartInfo = startInfo;
process.Start();
}

}


Expand Down
12 changes: 2 additions & 10 deletions ReleaseTools/InstallService.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
@echo OFF
echo Stopping old service version...
net stop "Network Game Copier Updater"
echo Uninstalling old service version...
sc delete "Network Game Copier Updater"

echo Installing service...
rem DO NOT remove the space after "binpath="!
sc create "Network Game Copier Updater" binpath= "UpdateService.exe"
echo Starting server complete
pause
%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe UpdateService.exe
exit
3 changes: 3 additions & 0 deletions ReleaseTools/UninstallService.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo OFF
%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /u UpdateService.exe
exit
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 1ec6d67

Please sign in to comment.