Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.{cs,xaml,csproj,wixproj,wxs,resx,xml}]
indent_style = space
indent_size = 4

[*.{md,yml,yaml}]
indent_style = space
indent_size = 2

[*.bat]
indent_style = space
indent_size = 4

[*.ps1]
indent_style = space
indent_size = 4
21 changes: 21 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
* text=auto

*.bat text eol=crlf
*.cs text eol=crlf
*.csproj text eol=crlf
*.resx text eol=crlf
*.wixproj text eol=crlf
*.wxs text eol=crlf
*.xaml text eol=crlf
*.xml text eol=crlf
*.md text eol=lf
*.ps1 text eol=crlf
*.yml text eol=lf
*.yaml text eol=lf

*.bmp binary
*.gif binary
*.ico binary
*.jpg binary
*.png binary
*.rtf binary
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Summary

<!-- Describe the change in one or two bullets. -->

## User Impact

<!-- Explain what users or maintainers should notice. -->

## Validation

- [ ] `git diff --check`
- [ ] XML/XAML/project files parse
- [ ] Release x64 build
- [ ] Smoke conversion checked
- [ ] Installer or Explorer integration checked when relevant

## Notes

<!-- Include follow-up work, risks, or release notes. -->
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: build

on:
push:
branches:
- integration
- master
- "codex/**"
pull_request:

permissions:
contents: read

env:
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
windows:
name: Windows x64
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Restore and build
shell: pwsh
run: .\build.ps1 -Configuration $env:BUILD_CONFIGURATION -Platform $env:BUILD_PLATFORM

- name: Upload app artifact
uses: actions/upload-artifact@v4
with:
name: ZFileConverter-app-x64
path: Application/FileConverter/bin/x64/Release/**
if-no-files-found: error

- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: ZFileConverter-installer-x64
path: Installer/bin/x64/Release/*.msi
if-no-files-found: warn
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: release

on:
workflow_dispatch:
inputs:
version:
description: "Release tag, for example v2.2.0"
required: true
type: string
prerelease:
description: "Mark as prerelease"
required: true
default: true
type: boolean

permissions:
contents: write

env:
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
windows-release:
name: Windows release
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Build
shell: pwsh
run: .\build.ps1 -Configuration $env:BUILD_CONFIGURATION -Platform $env:BUILD_PLATFORM

- name: Prepare artifacts
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$tag = "${{ inputs.version }}"
$version = $tag.TrimStart("v")
New-Item -ItemType Directory -Force artifacts | Out-Null
Copy-Item "Installer\bin\x64\Release\ZFileConverter-setup.msi" "artifacts\ZFileConverter-$version-x64-setup.msi"
Compress-Archive -Path "Application\FileConverter\bin\x64\Release\*" -DestinationPath "artifacts\ZFileConverter-$version-x64-app.zip" -Force

- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: ZFileConverter-release-${{ inputs.version }}
path: artifacts/*
if-no-files-found: error

- name: Create draft GitHub release
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.version }}
PRERELEASE: ${{ inputs.prerelease }}
run: |
$ErrorActionPreference = "Stop"
$files = Get-ChildItem artifacts -File | ForEach-Object { $_.FullName }
$arguments = @(
"release",
"create",
$env:RELEASE_TAG
) + $files + @(
"--target",
$env:GITHUB_SHA,
"--title",
"ZFileConverter $env:RELEASE_TAG",
"--generate-notes",
"--draft"
)
if ($env:PRERELEASE -eq "true") {
$arguments += "--prerelease"
}
gh @arguments
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
[Rr]eleases/
build/
bld/
artifacts/
[Bb]in/
[Oo]bj/

Expand Down
41 changes: 34 additions & 7 deletions Application/FileConverter/Application.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// <copyright file="Application.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>

/* File Converter - This program allow you to convert file format to another.
Copyright (C) 2026 Adrien Allard
/* ZFileConverter - This program allows you to convert one file format to another.
Copyright (C) 2026 ZaidNAlAsali and File Converter contributors
email: adrien.allard.pro@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -152,6 +152,12 @@ protected override void OnExit(ExitEventArgs e)
return;
}

if (!upgradeService.UpgradeVersionDescription.InstallerIsVerified)
{
Debug.LogError("Refuse to start upgrade installer because it has not passed integrity verification.");
return;
}

// Start process.
Debug.Log($"Start file converter upgrade from version {ApplicationVersion} to {upgradeService.UpgradeVersionDescription.LatestVersion}.");

Expand Down Expand Up @@ -218,9 +224,9 @@ private void RegisterServices()
private void Initialize()
{
#if BUILD32
Diagnostics.Debug.Log("File Converter v" + ApplicationVersion.ToString() + " (32 bits)");
Diagnostics.Debug.Log("ZFileConverter v" + ApplicationVersion.ToString() + " (32 bits)");
#else
Diagnostics.Debug.Log("File Converter v" + ApplicationVersion.ToString() + " (64 bits)");
Diagnostics.Debug.Log("ZFileConverter v" + ApplicationVersion.ToString() + " (64 bits)");
#endif

// Retrieve arguments.
Expand Down Expand Up @@ -276,7 +282,8 @@ private void Initialize()
if (index >= args.Length - 1)
{
Debug.LogError(errorCode: 0x0B, $"Invalid format.");
break;
Application.AskForShutdown();
return;
}

string shellExtensionPath = args[index + 1];
Expand All @@ -296,7 +303,8 @@ private void Initialize()
if (index >= args.Length - 1)
{
Debug.LogError(errorCode: 0x0D, $"Invalid format.");
break;
Application.AskForShutdown();
return;
}

string shellExtensionPath = args[index + 1];
Expand All @@ -311,6 +319,24 @@ private void Initialize()
return;
}

case "repair-shell-extension":
{
string shellExtensionPath = Helpers.GetDefaultShellExtensionPath();
if (index < args.Length - 1 && !args[index + 1].StartsWith("--"))
{
shellExtensionPath = args[index + 1];
index++;
}

if (!Helpers.RepairShellExtension(shellExtensionPath))
{
Debug.LogError(errorCode: 0x10, $"Failed to repair shell extension {shellExtensionPath}.");
}

Application.AskForShutdown();
return;
}

case "version":
Console.WriteLine(ApplicationVersion.ToString());
Application.AskForShutdown();
Expand Down Expand Up @@ -371,6 +397,7 @@ private void Initialize()

default:
Debug.LogError($"Unknown application argument: '--{parameterTitle}'.");
Application.AskForShutdown();
return;
}
}
Expand All @@ -388,7 +415,7 @@ private void RunConversions(List<string> filePaths, string conversionPresetName)
ISettingsService settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
if (settingsService.Settings == null)
{
Debug.LogError(errorCode: 0x04, "Can't load File Converter settings. The application will now shutdown, if you want to fix the problem yourself please edit or delete the file: C:\\Users\\UserName\\AppData\\Local\\FileConverter\\Settings.user.xml.");
Debug.LogError(errorCode: 0x04, "Can't load ZFileConverter settings. The application will now shutdown, if you want to fix the problem yourself please edit or delete the file: C:\\Users\\UserName\\AppData\\Local\\FileConverter\\Settings.user.xml.");
Application.AskForShutdown();
return;
}
Expand Down
32 changes: 22 additions & 10 deletions Application/FileConverter/Controls/ConversionJobControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Grid Margin="0,4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="64"/>
<ColumnDefinition Width="112"/>
</Grid.ColumnDefinitions>

<Grid Margin="10" Grid.Column="0">
Expand Down Expand Up @@ -54,15 +54,27 @@
</StackPanel>
</Grid>

<Button Margin="3" Grid.Column="1" Height="57"
Visibility="{Binding State, ConverterParameter=|InProgress|Collapsed, Converter={StaticResource EnumEqualsToVisibility}}"
Command="{Binding CancelCommand}" ToolTip="{x:Static project:Resources.CancelJobTooltip}">
<Image Source="/FileConverter;component/Resources/CancelIcon.png" Width="48" Height="48" Style="{StaticResource EnableDisableImageStyle}" />
</Button>
<Image Margin="3" Grid.Column="1" Source="/FileConverter;component/Resources/SuccessIcon.png" Width="48" Height="48"
Visibility="{Binding State, ConverterParameter=|Done|Collapsed, Converter={StaticResource EnumEqualsToVisibility}}"/>
<Image Margin="3" Grid.Column="1" Source="/FileConverter;component/Resources/FailIcon.png" Width="48" Height="48"
Visibility="{Binding State, ConverterParameter=|Failed|Collapsed, Converter={StaticResource EnumEqualsToVisibility}}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
<Image Margin="3" Source="/FileConverter;component/Resources/SuccessIcon.png" Width="48" Height="48"
Visibility="{Binding State, ConverterParameter=|Done|Collapsed, Converter={StaticResource EnumEqualsToVisibility}}"/>
<Image Margin="3" Source="/FileConverter;component/Resources/FailIcon.png" Width="48" Height="48"
Visibility="{Binding State, ConverterParameter=|Failed|Collapsed, Converter={StaticResource EnumEqualsToVisibility}}"/>
<Button Margin="3" Width="48" Height="57"
Visibility="{Binding State, ConverterParameter=|InProgress|Collapsed, Converter={StaticResource EnumEqualsToVisibility}}"
Command="{Binding CancelCommand}" ToolTip="{x:Static project:Resources.CancelJobTooltip}">
<Image Source="/FileConverter;component/Resources/CancelIcon.png" Width="40" Height="40" Style="{StaticResource EnableDisableImageStyle}" />
</Button>
<Button Margin="3" Width="48" Height="57"
Visibility="{Binding State, ConverterParameter=|Done|Collapsed, Converter={StaticResource EnumEqualsToVisibility}}"
Command="{Binding OpenOutputFolderCommand}" ToolTip="Open output folder">
<Image Source="/FileConverter;component/Resources/FolderIcon.ico" Width="40" Height="40" Style="{StaticResource EnableDisableImageStyle}" />
</Button>
<Button Margin="3" Width="48" Height="57"
Visibility="{Binding State, ConverterParameter=|Failed|Collapsed, Converter={StaticResource EnumEqualsToVisibility}}"
Command="{Binding RetryCommand}" ToolTip="Retry conversion">
<Image Source="/FileConverter;component/Resources/DuplicatePresetIcon.ico" Width="40" Height="40" Style="{StaticResource EnableDisableImageStyle}" />
</Button>
</StackPanel>
</Grid>
</Border>
</UserControl>
Loading