From 41116a62c2c5f51d8a2737962e02ade0256da4c4 Mon Sep 17 00:00:00 2001 From: LesFerch <79026235+LesFerch@users.noreply.github.com> Date: Sat, 23 Nov 2024 20:41:19 -0500 Subject: [PATCH] Add files via upload --- Src/WinSetViewJS.htm | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Src/WinSetViewJS.htm b/Src/WinSetViewJS.htm index 379fb57a..3f8bee78 100644 --- a/Src/WinSetViewJS.htm +++ b/Src/WinSetViewJS.htm @@ -85,7 +85,8 @@ } function MsgBox(prompt, buttons, title) { - oWSH.Popup(prompt, 0, title, buttons); + var result = oWSH.Popup(prompt, 0, title, buttons); + return(result); } function LCase(str) { @@ -203,6 +204,18 @@ if (!oFSO.FolderExists("Language")) oWSH.CurrentDirectory = window.external.ExecutableDir; MyFolder = oWSH.CurrentDirectory; + if (!oFSO.FolderExists("Language")) { + MsgBox("Language folder missing", vbCritical, "Error"); + self.close(); + window.close(); + return; + } + if (!oFSO.FolderExists("AppParts")) { + MsgBox("AppParts folder missing", vbCritical, "Error"); + self.close(); + window.close(); + return; + } if (MyFolder.indexOf("[") != -1 || MyFolder.indexOf("]") != -1) { a = "Current directory: " + MyFolder + Z + Z; @@ -271,10 +284,14 @@ // Copy Default INI files to AppData folder with overwrite off - oFolder = oFSO.GetFolder(MyFolder + "\\Defaults\\"); - oFiles = new Enumerator(oFolder.Files); - for (; !oFiles.atEnd(); oFiles.moveNext()) { - try { oFSO.CopyFile(oFiles.item(), AppData + "\\", false); } catch (e) {} + if (oFSO.FolderExists(MyFolder + "\\Defaults\\")) { + oFolder = oFSO.GetFolder(MyFolder + "\\Defaults\\"); + oFiles = new Enumerator(oFolder.Files); + if (oFiles) { + for (; !oFiles.atEnd(); oFiles.moveNext()) { + try { oFSO.CopyFile(oFiles.item(), AppData + "\\", false); } catch (e) {} + } + } } // See if there are any backup reg files in the Backup folder