Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
LesFerch authored Nov 24, 2024
1 parent d93fae4 commit 41116a6
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions Src/WinSetViewJS.htm
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 41116a6

Please sign in to comment.