diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..f5713ba
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 Denys Konovalov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Photomator.nsi b/Photomator.nsi
deleted file mode 100644
index e3f6dce..0000000
--- a/Photomator.nsi
+++ /dev/null
@@ -1,74 +0,0 @@
-Unicode true
-
-!include "MUI2.nsh"
-!include "x64.nsh"
-!include "nsDialogs.nsh"
-!include "FileFunc.nsh"
-
-Function .onInit
- ${If} ${RunningX64}
- # 64 bit code
- SetRegView 64
- ${Else}
- # 32 bit code
- MessageBox MB_OK "Photomator unterstützt nur 64-Bit-Systeme."
- Abort
- ${EndIf}
-FunctionEnd
-
-!define ARP "Software\Microsoft\Windows\CurrentVersion\Uninstall\Photomator"
-
-Name "Photomator"
-OutFile "photomator-setup.exe"
-
-BrandingText "Copyright (c) 2024 Denys Konovalov"
-
-InstallDir "$PROGRAMFILES\GCG\Photomator"
-
-RequestExecutionLevel admin
-
-!insertmacro MUI_LANGUAGE "German"
-
-!define MUI_ABORTWARNING
-
-!insertmacro MUI_PAGE_DIRECTORY
-!insertmacro MUI_PAGE_INSTFILES
-
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-
-Section "Install"
- SetOutPath $INSTDIR
-
- File /nonfatal /a /r "Photomator\bin\Release\net8.0\win-x64\publish\"
-
- CreateShortcut "$SMPROGRAMS\Photomator.lnk" "$INSTDIR\bin\Photomator.exe"
-
- WriteUninstaller "$INSTDIR\Uninstall.exe"
-
- ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
- IntFmt $0 "0x%08X" $0
- WriteRegDWORD HKLM "${ARP}" "EstimatedSize" "$0"
-
- WriteRegStr HKLM "${ARP}" "DisplayName" "Photomator"
- WriteRegStr HKLM "${ARP}" "InstallLocation" "$\"$INSTDIR$\""
- WriteRegStr HKLM "${ARP}" "Publisher" "Georg-Cantor-Gymnasium Halle (Saale)"
- WriteRegStr HKLM "${ARP}" "VersionMajor" "0"
- WriteRegStr HKLM "${ARP}" "VersionMinor" "01"
- WriteRegStr HKLM "${ARP}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
-SectionEnd
-
-Section "uninstall"
- SetRegView 64
-
- Delete "$SMPROGRAMS\Photomator.lnk"
-
- Delete "$INSTDIR\Uninstall.exe"
- RMDir /R "$INSTDIR\bin\"
- RMDir /R "$INSTDIR\lib\"
- RMDir /R "$INSTDIR\share\"
-
- DeleteRegKey HKLM "${ARP}"
-
- RMDir /R $INSTDIR
-SectionEnd
\ No newline at end of file
diff --git a/Photomator/AppInfo.cs b/Photomator/AppInfo.cs
index 58c4f3c..c5cba0d 100644
--- a/Photomator/AppInfo.cs
+++ b/Photomator/AppInfo.cs
@@ -5,7 +5,7 @@ public static class AppInfo {
public static readonly string IconName = "de.cantorgymnasium.Photomator";
public static readonly string Version = ThisAssembly.Git.Tag;
public static readonly string ReleaseNotes = @"
-
0.0.1
+ v0.0.1
Initial release
- single-file and folder conversions
diff --git a/Photomator/Photomator.csproj b/Photomator/Photomator.csproj
index 3fa513e..548dea9 100644
--- a/Photomator/Photomator.csproj
+++ b/Photomator/Photomator.csproj
@@ -1,7 +1,7 @@
- Exe
+ WinExe
net8.0
enable
enable
@@ -22,11 +22,10 @@
-
-
+
@@ -39,6 +38,7 @@
-
+
+
diff --git a/Photomator/Program.cs b/Photomator/Program.cs
index 44315c5..9e78051 100644
--- a/Photomator/Program.cs
+++ b/Photomator/Program.cs
@@ -24,7 +24,8 @@ public partial class Program {
"/usr"
};
string? prefix = prefixes.Find(prefix => File.Exists(prefix + "/share/de.cantorgymnasium.Photomator/de.cantorgymnasium.Photomator.gresource"));
- Gio.Functions.ResourcesRegister(Gio.Functions.ResourceLoad(Path.GetFullPath(prefix + "/share/de.cantorgymnasium.Photomator/de.cantorgymnasium.Photomator.gresource")));
+ if (prefix != null)
+ Gio.Functions.ResourcesRegister(Gio.Functions.ResourceLoad(Path.GetFullPath(prefix + "/share/de.cantorgymnasium.Photomator/de.cantorgymnasium.Photomator.gresource")));
}
_application.OnActivate += (_, _) => new MainWindow(_application).Start();
}
diff --git a/Photomator/Resources/Photomator.iss b/Photomator/Resources/Photomator.iss
new file mode 100644
index 0000000..ab30b0b
--- /dev/null
+++ b/Photomator/Resources/Photomator.iss
@@ -0,0 +1,65 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#define MyAppName "Photomator"
+
+#ifndef MyAppVersion
+#define MyAppVersion "v0.0.0-dev"
+#endif
+
+#define MyAppPublisher "Georg-Cantor-Gymnasium Halle (Saale)"
+#define MyAppURL "https://git.cantorgymnasium.de/gcg/photomator/"
+#define MyAppSupportURL "https://git.cantorgymnasium.de/gcg/photomator/issues/"
+#define MyAppUpdatesURL "https://git.cantorgymnasium.de/gcg/photomator/releases/"
+#define MyAppExeName "Photomator.exe"
+
+[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={{2F93EA62-DD17-4ACF-87B9-4B80B5217CC4}
+AppName={#MyAppName}
+;AppVersion={#MyAppVersion}
+AppVerName={#MyAppName} {#MyAppVersion}
+AppPublisher={#MyAppPublisher}
+AppPublisherURL={#MyAppURL}
+AppSupportURL={#MyAppSupportURL}
+AppUpdatesURL={#MyAppUpdatesURL}
+DefaultDirName={autopf}\{#MyAppName}
+; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
+; on anything but x64 and Windows 11 on Arm.
+ArchitecturesAllowed=x64compatible
+; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the
+; install be done in "64-bit mode" on x64 or Windows 11 on Arm,
+; meaning it should use the native 64-bit Program Files directory and
+; the 64-bit view of the registry.
+ArchitecturesInstallIn64BitMode=x64compatible
+DisableProgramGroupPage=yes
+LicenseFile=..\..\LICENSE
+; Uncomment the following line to run in non administrative install mode (install for current user only.)
+;PrivilegesRequired=lowest
+OutputDir=..\bin\Release\net8.0\win-x64\publish
+OutputBaseFilename={#MyAppName}-{#MyAppVersion}-win-x64-setup
+SetupIconFile=de.cantorgymnasium.Photomator.ico
+Compression=lzma
+SolidCompression=yes
+WizardStyle=modern
+
+[Languages]
+Name: "german"; MessagesFile: "compiler:Languages\German.isl"
+
+[Tasks]
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Files]
+Source: "..\bin\Release\net8.0\win-x64\publish\bin\*"; DestDir: "{app}\bin"; Flags: ignoreversion recursesubdirs createallsubdirs
+Source: "..\bin\Release\net8.0\win-x64\publish\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
+Source: "..\bin\Release\net8.0\win-x64\publish\share\*"; DestDir: "{app}\share"; Flags: ignoreversion recursesubdirs createallsubdirs
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Icons]
+Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\bin\{#MyAppExeName}"
+Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\bin\{#MyAppExeName}"; Tasks: desktopicon
+
+[Run]
+Filename: "{app}\bin\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
+
diff --git a/Photomator/Views/StatusDialog.cs b/Photomator/Views/StatusDialog.cs
index 14e7aaa..8c280ac 100644
--- a/Photomator/Views/StatusDialog.cs
+++ b/Photomator/Views/StatusDialog.cs
@@ -9,7 +9,6 @@ namespace Photomator.Views;
public partial class StatusDialog : Adw.Window {
private readonly Adw.Application _application;
private readonly Adw.ApplicationWindow _mainWindow;
- private readonly ViewStack _stack;
private readonly ProgressBar _progress;
public StatusDialog(Adw.Application application, Adw.ApplicationWindow parent) : base() {
@@ -22,14 +21,8 @@ public partial class StatusDialog : Adw.Window {
SetDeletable(true);
SetDefaultSize(400, 500);
- _stack = ViewStack.New();
- _stack.SetVexpand(true);
-
StatusPage pageStatus = InitPageProgress();
- _stack.AddNamed(pageStatus, "page-status");
- _stack.SetChildVisible(true);
-
- SetContent(_stack);
+ SetContent(pageStatus);
}
public void Start() {
@@ -92,9 +85,7 @@ public partial class StatusDialog : Adw.Window {
public void Success(int number, string dest) {
StatusPage pageSuccess = InitPageSuccess(number, dest);
- _stack.AddNamed(pageSuccess, "page-success");
- _stack.SetVisibleChildName("page-success");
- _stack.SetChildVisible(true);
+ SetContent(pageSuccess);
}
private StatusPage InitPagePartial(int number, string dest, ConvertError[] convertErrors) {
@@ -158,9 +149,7 @@ public partial class StatusDialog : Adw.Window {
public void Partial(int number, string dest, ConvertError[] convertErrors) {
StatusPage pagePartial = InitPagePartial(number, dest, convertErrors);
- _stack.AddNamed(pagePartial, "page-partial");
- _stack.SetVisibleChildName("page-partial");
- _stack.SetChildVisible(true);
+ SetContent(pagePartial);
}
private StatusPage InitPageError(string error) {
@@ -208,8 +197,6 @@ public partial class StatusDialog : Adw.Window {
public void Error(string error) {
StatusPage pageError = InitPageError(error);
- _stack.AddNamed(pageError, "page-error");
- _stack.SetVisibleChildName("page-error");
- _stack.SetChildVisible(true);
+ SetContent(pageError);
}
}
\ No newline at end of file