[#59] Documents: Move Documents install folder from ProgramData to Program Files
All checks were successful
Test / Run tests (push) Successful in 2m19s
All checks were successful
Test / Run tests (push) Successful in 2m19s
This commit is contained in:
@ -29,6 +29,9 @@ namespace Elwig {
|
||||
public static readonly string MailsPath = Path.Combine(DataPath, "mails");
|
||||
public static readonly string ConfigPath = Path.Combine(DataPath, "config.ini");
|
||||
public static readonly string ExePath = @"C:\Program Files\Elwig\";
|
||||
public static readonly string DocumentsPath = (Assembly.GetEntryAssembly()?.Location.Contains(@"\bin\") ?? false) ?
|
||||
Path.Combine(Assembly.GetEntryAssembly()!.Location.Split(@"\bin\")[0], "../Elwig/Documents") :
|
||||
Path.Combine(ExePath, "resources/Documents");
|
||||
public static readonly string TempPath = Path.Combine(Path.GetTempPath(), "Elwig");
|
||||
|
||||
public static Config Config { get; private set; } = new(ConfigPath);
|
||||
|
@ -2,7 +2,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.BusinessDocument>
|
||||
@model Elwig.Documents.BusinessDocument
|
||||
@{ Layout = "Document"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\BusinessDocument.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\BusinessDocument.css"/>
|
||||
<div class="info-wrapper">
|
||||
<div class="address-wrapper">
|
||||
<div class="sender">
|
||||
|
@ -3,7 +3,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.CreditNote>
|
||||
@model Elwig.Documents.CreditNote
|
||||
@{ Layout = "BusinessDocument"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\CreditNote.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\CreditNote.css" />
|
||||
<main>
|
||||
<h1>@Model.Title</h1>
|
||||
<table class="credit">
|
||||
|
@ -2,7 +2,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.DeliveryAncmtList>
|
||||
@model Elwig.Documents.DeliveryAncmtList
|
||||
@{ Layout = "Document"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\DeliveryAncmtList.css" />
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\DeliveryAncmtList.css" />
|
||||
<main>
|
||||
<h1>Anmeldeliste</h1>
|
||||
<h2>@Model.Filter</h2>
|
||||
|
@ -3,7 +3,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.DeliveryConfirmation>
|
||||
@model Elwig.Documents.DeliveryConfirmation
|
||||
@{ Layout = "BusinessDocument"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\DeliveryConfirmation.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\DeliveryConfirmation.css" />
|
||||
<main>
|
||||
<h1>@Model.Title</h1>
|
||||
<table class="delivery-confirmation">
|
||||
|
@ -2,7 +2,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.DeliveryDepreciationList>
|
||||
@model Elwig.Documents.DeliveryDepreciationList
|
||||
@{ Layout = "Document"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\DeliveryDepreciationList.css" />
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\DeliveryDepreciationList.css" />
|
||||
<main>
|
||||
<h1>Abwertungsliste</h1>
|
||||
<h2>@Model.Filter</h2>
|
||||
|
@ -2,7 +2,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.DeliveryJournal>
|
||||
@model Elwig.Documents.DeliveryJournal
|
||||
@{ Layout = "Document"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\DeliveryJournal.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\DeliveryJournal.css"/>
|
||||
<main>
|
||||
<h1>Lieferjournal</h1>
|
||||
<h2>@Model.Filter</h2>
|
||||
|
@ -2,7 +2,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.DeliveryNote>
|
||||
@model Elwig.Documents.DeliveryNote
|
||||
@{ Layout = "BusinessDocument"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\DeliveryNote.css" />
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\DeliveryNote.css" />
|
||||
<main>
|
||||
<h1>@Model.Title</h1>
|
||||
<table class="delivery large">
|
||||
|
@ -23,7 +23,7 @@ namespace Elwig.Documents {
|
||||
public bool ShowFoldMarks = App.Config.Debug;
|
||||
public bool DoublePaged = false;
|
||||
|
||||
public string DataPath;
|
||||
public string DocumentsPath;
|
||||
public int CurrentNextSeason;
|
||||
public string? DocumentId;
|
||||
public string Title;
|
||||
@ -34,7 +34,7 @@ namespace Elwig.Documents {
|
||||
|
||||
public Document(string title) {
|
||||
var c = App.Client;
|
||||
DataPath = App.DataPath;
|
||||
DocumentsPath = App.DocumentsPath;
|
||||
CurrentNextSeason = Utils.CurrentNextSeason;
|
||||
Title = title;
|
||||
Author = c.NameFull;
|
||||
|
@ -7,9 +7,9 @@
|
||||
<title>@Model.Title</title>
|
||||
<meta name="author" value="@Model.Author"/>
|
||||
<meta charset="UTF-8"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\Document.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\Document.Page.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\Document.Table.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\Document.css" />
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\Document.Page.css" />
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\Document.Table.css" />
|
||||
@if (Model.DoublePaged) {
|
||||
<style>
|
||||
@@page :left {
|
||||
|
@ -3,7 +3,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.MemberDataSheet>
|
||||
@model Elwig.Documents.MemberDataSheet
|
||||
@{ Layout = "BusinessDocument"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\MemberDataSheet.css" />
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\MemberDataSheet.css" />
|
||||
<main>
|
||||
<h1>@Model.Title</h1>
|
||||
<table class="member border">
|
||||
|
@ -2,7 +2,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.MemberList>
|
||||
@model Elwig.Documents.MemberList
|
||||
@{ Layout = "Document"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\MemberList.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\MemberList.css" />
|
||||
<main>
|
||||
<h1>Mitgliederliste</h1>
|
||||
<h2>@Model.Filter</h2>
|
||||
|
@ -3,7 +3,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.PaymentVariantSummary>
|
||||
@model Elwig.Documents.PaymentVariantSummary
|
||||
@{ Layout = "Document"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\PaymentVariantSummary.css" />
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\PaymentVariantSummary.css" />
|
||||
<main>
|
||||
<h1>Auszahlungsvariante Lese @Model.Variant.Year</h1>
|
||||
<h2>@Model.Variant.Name</h2>
|
||||
|
@ -3,7 +3,7 @@
|
||||
@inherits TemplatePage<Elwig.Documents.WineQualityStatistics>
|
||||
@model Elwig.Documents.WineQualityStatistics
|
||||
@{ Layout = "Document"; }
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\WineQualityStatistics.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DocumentsPath)\WineQualityStatistics.css" />
|
||||
<main>
|
||||
<h1>Qualitätsstatistik</h1>
|
||||
<h2>@Model.Filter</h2>
|
||||
|
@ -20,10 +20,6 @@
|
||||
<EmbeddedResource Include="Resources\Sql\*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="call fetch-resources.bat" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="LinqKit" Version="1.3.8" />
|
||||
|
@ -10,7 +10,7 @@ namespace Elwig.Helpers.Printing {
|
||||
|
||||
public static async Task Init(Action? evtHandler = null) {
|
||||
var e = new RazorLightEngineBuilder()
|
||||
.UseFileSystemProject(App.DataPath + "resources")
|
||||
.UseFileSystemProject(App.DocumentsPath)
|
||||
.UseMemoryCachingProvider()
|
||||
.Build();
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
::mkdir "C:\Program Files\Elwig"
|
||||
mkdir "C:\ProgramData\Elwig\resources"
|
||||
copy /b /y Documents\*.css "C:\ProgramData\Elwig\resources"
|
||||
copy /b /y Documents\*.cshtml "C:\ProgramData\Elwig\resources"
|
||||
::copy /b /y ..\Installer\Files\*.exe "C:\Program Files\Elwig\"
|
@ -1,23 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||
<Fragment>
|
||||
<!-- C:\Program Files (x86)\Elwig oder C:\Program Files\Elwig -->
|
||||
<!-- C:\Program Files (x86)\Elwig oder C:\Program Files\Elwig -->
|
||||
<StandardDirectory Id="ProgramFiles64Folder">
|
||||
<Directory Id="InstallFolder" Name="!(bind.Property.ProductName)" />
|
||||
<Directory Id="InstallFolder" Name="!(bind.Property.ProductName)">
|
||||
<Directory Id="InstallFolderResources" Name="resources">
|
||||
<Directory Id="InstallFolderDocuments" Name="Documents" />
|
||||
</Directory>
|
||||
</Directory>
|
||||
</StandardDirectory>
|
||||
|
||||
<!-- C:\ProgramData\Elwig -->
|
||||
<StandardDirectory Id="CommonAppDataFolder">
|
||||
<Directory Id="ConfigFolder" Name="!(bind.Property.ProductName)">
|
||||
<Directory Id="ConfigFolderResources" Name="resources" />
|
||||
</Directory>
|
||||
</StandardDirectory>
|
||||
|
||||
<!-- C:\ProgramData\Microsoft\Windows\Start Menu\Programs -->
|
||||
<StandardDirectory Id="ProgramMenuFolder">
|
||||
<Directory Id="StartMenuProgramsFolder" Name="!(bind.Property.ProductName)" />
|
||||
</StandardDirectory>
|
||||
|
||||
<!-- C:\Users{USERNAME}\Desktop -->
|
||||
<StandardDirectory Id="DesktopFolder" />
|
||||
|
||||
<!-- C:\ProgramData\Elwig -->
|
||||
<StandardDirectory Id="CommonAppDataFolder">
|
||||
<Directory Id="ConfigFolder" Name="!(bind.Property.ProductName)" />
|
||||
</StandardDirectory>
|
||||
|
||||
<!-- C:\ProgramData\Microsoft\Windows\Start Menu\Programs -->
|
||||
<StandardDirectory Id="ProgramMenuFolder">
|
||||
<Directory Id="StartMenuProgramsFolder" Name="!(bind.Property.ProductName)" />
|
||||
</StandardDirectory>
|
||||
|
||||
<!-- C:\Users\{USERNAME}\Desktop -->
|
||||
<StandardDirectory Id="DesktopFolder" />
|
||||
</Fragment>
|
||||
</Wix>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||
<Fragment>
|
||||
<ComponentGroup Id="HeatComponents">
|
||||
<Files Directory="InstallFolder" Include="..\Elwig\bin\Publish\**">
|
||||
<Exclude Files="..\Elwig\bin\Publish\**.exe" />
|
||||
<Exclude Files="..\Elwig\bin\Publish\**.pdb" />
|
||||
</Files>
|
||||
<Files Directory="ConfigFolderResources" Include="..\Elwig\Documents\**">
|
||||
<Exclude Files="..\Elwig\Documents\**.cs" />
|
||||
</Files>
|
||||
</ComponentGroup>
|
||||
<ComponentGroup Id="HeatComponents">
|
||||
<Files Directory="InstallFolder" Include="..\Elwig\bin\Publish\**">
|
||||
<Exclude Files="..\Elwig\bin\Publish\**.exe" />
|
||||
<Exclude Files="..\Elwig\bin\Publish\**.pdb" />
|
||||
</Files>
|
||||
<Files Directory="InstallFolderDocuments" Include="..\Elwig\Documents\**">
|
||||
<Exclude Files="..\Elwig\Documents\**.cs" />
|
||||
</Files>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
|
Reference in New Issue
Block a user