improvements deploy script
This commit is contained in:
parent
ef30afa013
commit
1d3064904a
@ -3,4 +3,4 @@ Write-Host "==> Build App as release ..."
|
|||||||
Invoke-Expression ".\build-release.ps1"
|
Invoke-Expression ".\build-release.ps1"
|
||||||
|
|
||||||
# --- copy files to target client
|
# --- copy files to target client
|
||||||
U:\HomeLab\Scripts\Windows\deploy_via_psexec.ps1 -RemoteComputer "Cambooth" -LocalUsername "Administrator" -LocalPassword "2013" -EDSDKFolder "../misc/CanonBinaries" -SourceFolder "../src/CamBooth/CamBooth.App/publish" -DestinationFolder "C:\Cambooth" -ProcessesToStop @("MyWPFApp") -ServicesToStop @("MyService") -AppExecutable "MyWPFApp.exe"
|
U:\HomeLab\Scripts\Windows\deploy_via_psexec.ps1 -RemoteComputer "Cambooth" -LocalUsername "Administrator" -LocalPassword "2013" -EDSDKFolder "../misc/CanonBinaries" -SourceFolder "../src/CamBooth/CamBooth.App/publish" -DestinationFolder "C:\Cambooth" -ProcessesToStop @("Cambooth.App") -ServicesToStop @("MyService") -AppExecutable "Cambooth.App.exe"
|
||||||
|
|||||||
@ -1,30 +1,39 @@
|
|||||||
namespace CamBooth.App.Core.AppSettings;
|
using CamBooth.App.Core.Logging;
|
||||||
|
|
||||||
|
namespace CamBooth.App.Core.AppSettings;
|
||||||
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
public class AppSettingsService
|
public class AppSettingsService
|
||||||
{
|
{
|
||||||
|
private readonly Logger _logger;
|
||||||
|
|
||||||
IConfigurationRoot configuration;
|
IConfigurationRoot configuration;
|
||||||
|
|
||||||
public AppSettingsService()
|
private string loadedConfigFile = string.Empty;
|
||||||
|
|
||||||
|
public AppSettingsService(Logger logger)
|
||||||
{
|
{
|
||||||
|
this._logger = logger;
|
||||||
this.Initialize();
|
this.Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Initialize()
|
private void Initialize()
|
||||||
{
|
{
|
||||||
var configFile = "Core/AppSettings/app.settings.json";
|
loadedConfigFile = "Core/AppSettings/app.settings.json";
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
configFile = "Core/AppSettings/app.settings.dev.json";
|
loadedConfigFile = "Core/AppSettings/app.settings.dev.json";
|
||||||
#endif
|
#endif
|
||||||
configuration = new ConfigurationBuilder()
|
configuration = new ConfigurationBuilder()
|
||||||
.SetBasePath(AppContext.BaseDirectory)
|
.SetBasePath(AppContext.BaseDirectory)
|
||||||
.AddJsonFile(configFile, optional: false, reloadOnChange: true)
|
.AddJsonFile(loadedConfigFile, optional: false, reloadOnChange: true)
|
||||||
.Build();
|
.Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string? AppName => configuration["AppSettings:AppName"];
|
public string? AppName => configuration["AppSettings:AppName"];
|
||||||
public string? PictureLocation => configuration["AppSettings:PictureLocation"];
|
public string? PictureLocation => configuration["AppSettings:PictureLocation"];
|
||||||
public string? ConnectionString => configuration.GetConnectionString("DefaultConnection");
|
public string? ConnectionString => configuration.GetConnectionString("DefaultConnection");
|
||||||
|
|
||||||
|
public string ConfigFileName => loadedConfigFile;
|
||||||
}
|
}
|
||||||
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"AppSettings": {
|
"AppSettings": {
|
||||||
"AppName": "Meine Anwendung",
|
"AppName": "Meine Anwendung",
|
||||||
"Version": "1.0.0"
|
"Version": "1.0.0",
|
||||||
|
"PictureLocation": "C:\\cambooth\\pictures"
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Server=myServer;Database=myDB;User Id=myUser;Password=myPassword;"
|
"DefaultConnection": "Server=myServer;Database=myDB;User Id=myUser;Password=myPassword;"
|
||||||
|
|||||||
@ -46,6 +46,7 @@ public partial class MainWindow : Window
|
|||||||
_ = this._pictureGalleryService.LoadThumbnailsToCache();
|
_ = this._pictureGalleryService.LoadThumbnailsToCache();
|
||||||
this.Closing += OnClosing;
|
this.Closing += OnClosing;
|
||||||
TimerControlRectangleAnimation.OnTimerEllapsed += TimerControlRectangleAnimation_OnTimerEllapsed;
|
TimerControlRectangleAnimation.OnTimerEllapsed += TimerControlRectangleAnimation_OnTimerEllapsed;
|
||||||
|
logger.Info($"config file loaded: '{appSettings.ConfigFileName}'");
|
||||||
logger.Info("MainWindow initialized");
|
logger.Info("MainWindow initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user