diff --git a/Agent.Installer.Win/MainWindow.xaml b/Agent.Installer.Win/MainWindow.xaml
index 87a5af68..c95ffb05 100644
--- a/Agent.Installer.Win/MainWindow.xaml
+++ b/Agent.Installer.Win/MainWindow.xaml
@@ -67,7 +67,7 @@
Cursor="Hand"
ToolTip="Enter the organization ID that will have access to this device.">
-
+
diff --git a/Agent.Installer.Win/ViewModels/MainWindowViewModel.cs b/Agent.Installer.Win/ViewModels/MainWindowViewModel.cs
index cc5f3231..9b743f79 100644
--- a/Agent.Installer.Win/ViewModels/MainWindowViewModel.cs
+++ b/Agent.Installer.Win/ViewModels/MainWindowViewModel.cs
@@ -1,4 +1,4 @@
-using Remotely.Agent.Installer.Win.Services;
+using Remotely.Agent.Installer.Win.Services;
using Remotely.Shared.Models;
using System;
using System.Collections.Generic;
@@ -193,9 +193,10 @@ namespace Remotely.Agent.Installer.Win.ViewModels
CopyCommandLineArgs();
var fileName = Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location);
- if (fileName.Length > 36)
+
+ for (var i = 0; i < fileName.Length; i++)
{
- var guid = fileName.Substring(fileName.Length - 36);
+ var guid = string.Join("", fileName.Skip(i).Take(36));
if (Guid.TryParse(guid, out _))
{
OrganizationID = guid;