From b0356d63e04dc07fd07a3fc021f5a2a71fde92db Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Wed, 30 Apr 2025 14:39:11 -0400 Subject: [PATCH] feature/IO-3205-Paint-Scale-Integrations: Code Review Revisions --- electron-builder.imex.yml | 1 - electron-builder.rome.yml | 1 - src/main/ipc/paintScaleHandlers/PPG.ts | 6 ++++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/electron-builder.imex.yml b/electron-builder.imex.yml index d127c8f..07022f3 100644 --- a/electron-builder.imex.yml +++ b/electron-builder.imex.yml @@ -26,7 +26,6 @@ nsis: shortcutName: ${productName} uninstallDisplayName: ${productName} createDesktopShortcut: always - perMachine: true # Ensure elevated privileges include: "scripts/installer.nsh" # Reference NSIS script from scripts directory mac: entitlementsInherit: build/entitlements.mac.plist diff --git a/electron-builder.rome.yml b/electron-builder.rome.yml index 89a7342..958819d 100644 --- a/electron-builder.rome.yml +++ b/electron-builder.rome.yml @@ -26,7 +26,6 @@ nsis: shortcutName: ${productName} uninstallDisplayName: ${productName} createDesktopShortcut: always - perMachine: true # Ensure elevated privileges include: "scripts/installer.nsh" # Reference NSIS script from scripts directory mac: entitlementsInherit: build/entitlements.mac.plist diff --git a/src/main/ipc/paintScaleHandlers/PPG.ts b/src/main/ipc/paintScaleHandlers/PPG.ts index 54d46c6..da66331 100644 --- a/src/main/ipc/paintScaleHandlers/PPG.ts +++ b/src/main/ipc/paintScaleHandlers/PPG.ts @@ -53,7 +53,8 @@ export async function ppgInputHandler(config: PaintScaleConfig): Promise { await parseStringPromise(xmlContent); } catch (error) { log.error(`Invalid XML in ${filePath}:`, error); - const errorPath = path.join(errorDir, path.basename(filePath)); + const timestamp = Date.now().toString(); // similar to DateTime.Now.Ticks in C# + const errorPath = path.join(errorDir, `${timestamp}.xml`); await fs.rename(filePath, errorPath); log.debug(`Moved invalid file to error: ${errorPath}`); continue; @@ -92,7 +93,8 @@ export async function ppgInputHandler(config: PaintScaleConfig): Promise { if (response.status === 200) { log.info(`Successful upload of ${filePath}`); // Move file to archive - const archivePath = path.join(archiveDir, path.basename(filePath)); + const timestamp = Date.now().toString(); // generate new timestamp + const archivePath = path.join(archiveDir, `${timestamp}.xml`); await fs.rename(filePath, archivePath); log.debug(`Moved file to archive: ${archivePath}`); } else {