Skip to content

Commit

Permalink
Merge pull request #2 from RudolfJan/Installer
Browse files Browse the repository at this point in the history
Prepared for alpha release v0.1
  • Loading branch information
RudolfJan authored May 4, 2020
2 parents b9d1910 + 9c972c5 commit 61d4e65
Show file tree
Hide file tree
Showing 37 changed files with 3,819 additions and 64 deletions.
Binary file added Installer/CSXicon.bmp
Binary file not shown.
11 changes: 11 additions & 0 deletions Installer/License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
All contents in this package are licensed under following Creative Common license:

CC Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)

This license lets others remix, tweak, and build upon your work non-commercially, as long as they credit you and license their new creations under identical terms.

The content is provided "as-is" and by using it you agree the author is NOT liable in any form for the use of this software. Usage is completely at your onw risk.

You are NOT entitled any form of support, though feedback is welcome.

You understand that Dovetail Games Ltd or any related company is NOT involved in this software package by any means and cannot be held responsible for the use of this software.
11 changes: 11 additions & 0 deletions Installer/Output/License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
All contents in this package are licensed under following Creative Common license:

CC Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)

This license lets others remix, tweak, and build upon your work non-commercially, as long as they credit you and license their new creations under identical terms.

The content is provided "as-is" and by using it you agree the author is NOT liable in any form for the use of this software. Usage is completely at your onw risk.

You are NOT entitled any form of support, though feedback is welcome.

You understand that Dovetail Games Ltd or any related company is NOT involved in this software package by any means and cannot be held responsible for the use of this software.
21 changes: 21 additions & 0 deletions Installer/Output/Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
TimetableTool

TimetableTool is a toolkit to help you to design timetables for transportation simulators. The tool is NOT suitable to design timetables for real world application and should not nbe used for this purpose.
This tool is NOT free, if you use it on a regular basis, you are supposed to donate to the author:

Euro 5 for private non-commercial use
Euro 25 per user per year for professional use.

Check out http:/www.hollandhiking.nl/trainsimulator for other tools and documentation for TSW and TrainSimulator.

Installation instructions:
- Use the installer to install
- Read the manual, which you can find in your Documents folder in the folder TimetableTool.
The tool comes with two demo timetables.

See the manual for details.

Version history:

Version 0.1
First public alpha version. This version is intended for review and feedback purposes only.
Binary file added Installer/Output/TimetableToolSetup v0.1.zip
Binary file not shown.
Binary file added Installer/Output/TimetableToolSetup.exe
Binary file not shown.
21 changes: 21 additions & 0 deletions Installer/Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
TimetableTool

TimetableTool is a toolkit to help you to design timetables for transportation simulators. The tool is NOT suitable to design timetables for real world application and should not nbe used for this purpose.
This tool is NOT free, if you use it on a regular basis, you are supposed to donate to the author:

Euro 5 for private non-commercial use
Euro 25 per user per year for professional use.

Check out http:/www.hollandhiking.nl/trainsimulator for other tools and documentation for TSW and TrainSimulator.

Installation instructions:
- Use the installer to install
- Read the manual, which you can find in your Documents folder in the folder TimetableTool.
The tool comes with two demo timetables.

See the manual for details.

Version history:

Version 0.1
First public alpha version. This version is intended for review and feedback purposes only.
Binary file added Installer/Setup.bmp
Binary file not shown.
Binary file added Installer/TSW_Cindy_1489778724_00.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
820 changes: 820 additions & 0 deletions Installer/TimetableData.sql

Large diffs are not rendered by default.

Binary file added Installer/TimetableDb.db
Binary file not shown.
879 changes: 879 additions & 0 deletions Installer/TimetableDb.db.sql

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions Installer/TimetableToolSetupv0.1.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "TimetableTool"
#define MyAppVersion "0.1 alpha"
#define MyAppPublisher "Holland Hiking"
#define MyAppURL "http://www.hollandhiking.nl/trainsimulator"
#define MyAppExeName "TimetableTool.exe"
; #define DataDirName= "{code:GetDataDir}"
; #define DefaultDirName="{code:GetInstallDir}"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{0C16F964-B19F-4E40-AFF0-F5AFB66EED9E}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=License.txt
InfoBeforeFile=Readme.txt
OutputDir= Output
OutputBaseFilename=TimetableToolSetup
Compression=lzma
SolidCompression=yes
WizardImageFile=Setup.bmp
WizardImageBackColor=clInfoBk
WizardImageStretch=False
AppCopyright=2020 Rudolf Heijink
DisableWelcomePage=no
DisableDirPage=no

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\TimetableTool.exe"; DestDir: "{app}"; DestName: "{#MyAppExeName}"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\appsettings.json"; DestDir: "{app}"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\TimetableTool.runtimeconfig.json"; DestDir: "{app}"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\TimetableTool.deps.json"; DestDir: "{app}"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\*.dll"; DestDir: "{app}"
Source: "..\Manual\TimetableTool Manual.pdf"; DestDir: "{userdocs}\TimetableTool"
Source: "..\TimetableTool.Desktop\appsettings.json"; DestDir: "{app}"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\SQL\*.sql"; DestDir: "{app}\SQL"
Source: "TimetableDb.db"; DestDir: "{userdocs}\TimetableTool"
Source: "*.txt"; DestDir: "{userdocs}\TimetableTool"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\runtimes\win-x86\native\netstandard2.0\SQLite.Interop.dll"; DestDir: "{app}\runtimes\win-x86\native\netstandard2.0"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\runtimes\win-x86\native\sni.dll"; DestDir: "{app}\runtimes\win-x86\native"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\cs-CZ\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\cs-CZ"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\de\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\de"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\es\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\es"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\fr\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\fr"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\hu\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\hu"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\pt-BR\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\pt-BR"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\it\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\it"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\ro\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\ro"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\ru\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\ru"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\sv\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\sv"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\ro\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\ro"
Source: "..\TimetableTool.Desktop\bin\Release\netcoreapp3.1\zh-Hans\Xceed.Wpf.AvalonDock.resources.dll"; DestDir: "{app}\zh-Hans"


[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Code]
[Run]
Filename: "{app}\{#MyAppExeName}"; Flags: nowait postinstall skipifsilent 32bit; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"

[Registry]

Binary file added Manual/Thumbs.db
Binary file not shown.
Binary file not shown.
Binary file added Manual/TimetableTool Manual.docx
Binary file not shown.
Binary file added Manual/TimetableTool Manual.pdf
Binary file not shown.
Binary file added Manual/Timetabletool images.pub
Binary file not shown.
76 changes: 76 additions & 0 deletions Squirrel-for-dot-net-core.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
async Task checkForSquirrelUpdates()
{
try {
var (exitCode, output) = await RunSquirrel("--update https://example.org/updates");

if (exitCode != 0) {
// TODO: Log update errors to Sentry
this.Log().Warn($"Failed to update! {output}");
}
} catch (Exception ex) {
this.Log().Error(ex, $"Failed to invoke Update.exe");
}
}

public Task<(int exitCode, string output)> RunSquirrel(string args)
{
string updateDotExe;
try {
updateDotExe = Path.GetFullPath("../Update.exe", Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));

if (!File.Exists(updateDotExe)) throw new Exception("update.exe doesn't exist");
} catch (Exception ex) {
this.Log().Warn(ex, $"Update.exe not found, this is probably not a deployed app");
return Task.FromException<(int, string)>(new Exception("Not a deployed app"));
}

return invokeProcessAsync(updateDotExe, args, CancellationToken.None, Path.GetDirectoryName(updateDotExe));
}

public bool IsAppDeployed()
{
var updateDotExe = Path.GetFullPath("../Update.exe", Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));
return File.Exists(updateDotExe);
}

static Task<(int exitCode, string output)> invokeProcessAsync(string fileName, string arguments, CancellationToken ct, string workingDirectory = "")
{
var psi = new ProcessStartInfo(fileName, arguments);

psi.UseShellExecute = false;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.ErrorDialog = false;
psi.CreateNoWindow = true;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.WorkingDirectory = workingDirectory;

return invokeProcessAsync(psi, ct);
}

static async Task<(int exitCode, string output)> invokeProcessAsync(ProcessStartInfo psi, CancellationToken ct)
{
var pi = Process.Start(psi);
await Task.Run(() => {
while (!ct.IsCancellationRequested) {
if (pi.WaitForExit(2000)) return;
}

if (ct.IsCancellationRequested) {
pi.Kill();
ct.ThrowIfCancellationRequested();
}
});

string textResult = await pi.StandardOutput.ReadToEndAsync();
if (String.IsNullOrWhiteSpace(textResult) || pi.ExitCode != 0) {
textResult = (textResult ?? "") + "\n" + await pi.StandardError.ReadToEndAsync();

if (String.IsNullOrWhiteSpace(textResult)) {
textResult = String.Empty;
}
}

return (pi.ExitCode, textResult.Trim());
}
}
1 change: 1 addition & 0 deletions TimeTableTool.Desktop/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Windows;
using TimetableTool.Desktop.ViewModels;
using TimetableTool.Desktop.Views;
using System.Threading.Tasks;

namespace TimetableTool.Desktop
{
Expand Down
Loading

0 comments on commit 61d4e65

Please sign in to comment.