Skip to content

Commit

Permalink
update v0.13
Browse files Browse the repository at this point in the history
- Fix custom path
  • Loading branch information
Amerlander committed May 11, 2023
1 parent 5691397 commit 0cacb07
Show file tree
Hide file tree
Showing 37 changed files with 704 additions and 68 deletions.
16 changes: 15 additions & 1 deletion x86/CalliopeMini.Uploader/CodeTheCalliopeMini.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -66,6 +66,18 @@
<PropertyGroup>
<ManifestCertificateThumbprint>A205CEF16D50FD09E8D12F9413CF2EF341F0CF9A</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestTimestampUrl>http://timestamp.sectigo.com</ManifestTimestampUrl>
</PropertyGroup>
<PropertyGroup>
<TargetZone>Internet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
Expand Down Expand Up @@ -126,6 +138,8 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="calliope-sectigo.pfx" />
<None Include="Properties\app.manifest" />
<None Include="Resources\MSR-LA - 2576.rtf" />
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions x86/CalliopeMini.Uploader/CodeTheCalliopeMini.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@
<FallbackCulture>de-DE</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup>
<DebugSecurityZoneURL>https://calliope.cc</DebugSecurityZoneURL>
</PropertyGroup>
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions x86/CalliopeMini.Uploader/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 31 additions & 10 deletions x86/CalliopeMini.Uploader/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ internal partial class MainForm : Form
{
FileSystemWatcher watcher;
private string customcopypath = "";
//private string customDownloadspath = "";
private string downloads;

public MainForm()
{
Expand All @@ -22,10 +24,19 @@ public MainForm()
this.versionLabel.Text = "v" + v.Major + "." + v.Minor;
}

public void ReloadFileWatch(string path)
{
customcopypath = path;
initializeFileWatch();
}


private void MainForm_Load(object sender, EventArgs e)
{
this.initializeFileWatch();
customcopypath = (string)Application.UserAppDataRegistry.GetValue("CustomDirectory", "");
//customcopypath = (string)Application.UserAppDataRegistry.GetValue("CustomDirectory", "");
//customDownloadspath = (string)Application.UserAppDataRegistry.GetValue("CustomDownloadsDirectory", "");

// this.openEditor();
}

Expand All @@ -43,10 +54,19 @@ private void openWebsite()

private void initializeFileWatch()
{
// if (!checkTOU()) return;
// if (!checkTOU()) return;
customcopypath = (string)Application.UserAppDataRegistry.GetValue("CustomDirectory", "");

var downloads = KnownFoldersNativeMethods.GetDownloadPath();
if (downloads == null)
if (!String.IsNullOrEmpty(customcopypath) && Directory.Exists(customcopypath))
{
downloads = customcopypath;
}
else
{
downloads = KnownFoldersNativeMethods.GetDownloadPath();
}

if (String.IsNullOrEmpty(downloads) || !Directory.Exists(downloads))
{
this.updateStatus("oops, der `Downloads` Ordner kann nicht gefunden werden. Bitte gibt einen Pfad in den Einstellungen an.");
return;
Expand All @@ -62,8 +82,8 @@ private void initializeFileWatch()

private void waitingForHexFileStatus()
{
this.updateStatus("Warte auf .hex-Datei...");
this.trayIcon.ShowBalloonTip(3000, "Bereit...", "Warte auf .hex-Datei...", ToolTipIcon.None);
this.updateStatus($"Warte auf .hex-Datei in {downloads} ...");
this.trayIcon.ShowBalloonTip(3000, "Bereit...", $"Warte auf .hex-Datei in {downloads} ...", ToolTipIcon.None);
}

static bool checkTOU()
Expand Down Expand Up @@ -137,10 +157,10 @@ void handleFile(string fullPath)
{
drives.Add(d.RootDirectory.FullName);
}
if (!String.IsNullOrEmpty(customcopypath) && Directory.Exists(customcopypath))
{
drives.Add(customcopypath);
}
//if (!String.IsNullOrEmpty(customcopypath) && Directory.Exists(customcopypath))
//{
// drives.Add(customcopypath);
//}
if (drives.Count == 0)
{
this.updateStatus("Kein mini gefunden");
Expand Down Expand Up @@ -265,6 +285,7 @@ private void backgroundPictureBox_Click(object sender, EventArgs e)
private void SettingsLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
var settings = new Settings(customcopypath);

settings.ShowDialog();
customcopypath = settings.CustomCopyPath;
Application.UserAppDataRegistry.SetValue("CustomDirectory", customcopypath, RegistryValueKind.String);
Expand Down
12 changes: 6 additions & 6 deletions x86/CalliopeMini.Uploader/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
[assembly: AssemblyTitle("Calliope mini auto uploader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("MicrosoftCalliopeMiniUploader")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
[assembly: AssemblyCompany("Calliope gGmbH")]
[assembly: AssemblyProduct("Calliope Mini Uploader")]
[assembly: AssemblyCopyright("Copyright © Calliope 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -34,7 +34,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.12.0.0")]
[assembly: AssemblyFileVersion("0.12.0.0")]
[assembly: AssemblyVersion("0.13.0.0")]
[assembly: AssemblyFileVersion("0.13.0.0")]
[assembly: CLSCompliant(true)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: NeutralResourcesLanguage("de-DE")]
73 changes: 73 additions & 0 deletions x86/CalliopeMini.Uploader/Properties/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC-Manifestoptionen
Wenn Sie die Ebene der Benutzerkontensteuerung für Windows ändern möchten, ersetzen Sie den
Knoten "requestedExecutionLevel" wie folgt.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Durch Angabe des Elements "requestedExecutionLevel" wird die Datei- und Registrierungsvirtualisierung deaktiviert.
Entfernen Sie dieses Element, wenn diese Virtualisierung aus Gründen der Abwärtskompatibilität
für die Anwendung erforderlich ist.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Eine Liste der Windows-Versionen, unter denen diese Anwendung getestet
und für die sie entwickelt wurde. Wenn Sie die Auskommentierung der entsprechenden Elemente aufheben,
wird von Windows automatisch die kompatibelste Umgebung ausgewählt. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Gibt an, dass die Anwendung mit DPI-Werten kompatibel ist und von Windows nicht automatisch auf höhere
DPI-Werte skaliert wird. WPF-Anwendungen (Windows Presentation Foundation) sind automatisch mit DPI-Werten kompatibel, eine Aktivierung
ist nicht erforderlich. Für Windows Forms-Anwendungen für .NET Framework 4.6, die diese Einstellung aktivieren, muss
auch die Einstellung "'EnableWindowsFormsHighDpiAutoResizing" in der Datei "app.config" auf TRUE festgelegt werden.
Hierdurch können für die Anwendung lange Pfade verwendet werden. Weitere Informationen finden Sie unter https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation.-->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- Designs für allgemeine Windows-Steuerelemente und -Dialogfelder (Windows XP und höher) aktivieren -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
32 changes: 18 additions & 14 deletions x86/CalliopeMini.Uploader/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion x86/CalliopeMini.Uploader/Settings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
Expand All @@ -11,7 +12,9 @@ namespace Microsoft.CalliopeMini
{
public partial class Settings : Form
{

public string CustomCopyPath;

public Settings(string currentpath)
{
InitializeComponent();
Expand All @@ -32,6 +35,28 @@ private void label1_Click(object sender, EventArgs e)
private void textBox1_TextChanged(object sender, EventArgs e)
{
CustomCopyPath = textBox1.Text;
Application.UserAppDataRegistry.SetValue("CustomDirectory", CustomCopyPath, RegistryValueKind.String);
var mainForm = (MainForm)Application.OpenForms["MainForm"];
mainForm.ReloadFileWatch(CustomCopyPath);

}

private void button1_Click(object sender, EventArgs e)
{
using (var fbd = new FolderBrowserDialog())
{
fbd.ShowNewFolderButton = true;
fbd.RootFolder = Environment.SpecialFolder.Desktop;
fbd.SelectedPath = CustomCopyPath;
fbd.Description = "Wählen Sie einen Ordner aus, um den Pfad auszuwählen:";
fbd.ShowDialog();

if (!string.IsNullOrWhiteSpace(fbd.SelectedPath))
{
CustomCopyPath = fbd.SelectedPath;
textBox1.Text = CustomCopyPath;
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="CalliopeMiniUploader.application" version="1.0.0.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="CalliopeMiniUploader" asmv2:product="CalliopeMiniUploader" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true" />
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="CalliopeMiniUploader.exe.manifest" size="5153">
<assemblyIdentity name="CalliopeMiniUploader.exe" version="1.0.0.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>IKniPdUm/3dRwoG/LjmSJsG/0hM=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
</asmv1:assembly>
Binary file modified x86/CalliopeMini.Uploader/bin/Debug/CalliopeMiniUploader.exe
Binary file not shown.
Loading

0 comments on commit 0cacb07

Please sign in to comment.