Skip to content

Commit 5e2c222

Browse files
committed
26.2.2 Some fix
1 parent 6c15988 commit 5e2c222

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

Debug/script/options.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@
8989
<label><input type="checkbox" id="!Conf_NoAutocomplete">@ieframe.dll,-12806[Autocomplete]</label>
9090
<br><br>
9191
<label>@sdclt.exe,-1156[Back Up Files]</label> (*.bak)<br>
92-
<input type="text" name="Conf_Backup" style="display: none">
93-
<label><input type="radio" name="Conf_Backup_" id="Conf_Backup=0" onclick="SetRadio(this)">@fde.dll,-905[Leave in Existing Location]</label><br>
94-
<label><input type="radio" name="Conf_Backup_" id="Conf_Backup=1" onclick="SetRadio(this)">Delete</label><br>
95-
<label><input type="radio" name="Conf_Backup_" id="Conf_Backup=2" onclick="SetRadio(this)">@shell32.dll,-37384[-8964]</label><br>
92+
<input type="text" name="Conf_BAK" style="display: none">
93+
<label><input type="radio" name="Conf_BAK_" id="Conf_BAK=0" onclick="SetRadio(this)">None</label><br>
94+
<label><input type="radio" name="Conf_BAK_" id="Conf_BAK=1" onclick="SetRadio(this)">@fde.dll,-905[Leave in Existing Location]</label><br>
95+
<label><input type="radio" name="Conf_BAK_" id="Conf_BAK=2" onclick="SetRadio(this)">@shell32.dll,-8964</label><br>
9696
<br>
9797
<div class="block">
9898
<button name="ButtonInitConfig" onclick="InitConfig(this);">Initialize config folder</button>

Debug/script/sync.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ g_.arError = api.CreateObject("Array");
6969

7070
AboutTE = function (n) {
7171
if (n == 0) {
72-
return te.Version < 20260127 ? te.Version : 20260129;
72+
return te.Version < 20260127 ? te.Version : 20260202;
7373
}
7474
if (n == 1) {
7575
const v = AboutTE(0);
@@ -697,13 +697,24 @@ LoadXml = function (filename, nGroup) {
697697
}
698698

699699
SafeReplaceFile = function (path) {
700-
if (api.ReplaceFile(path, path + ".tmp", path + ".bak", REPLACEFILE_WRITE_THROUGH)) {
701-
if (te.Data.Conf_Backup) {
702-
DeleteItem(path + ".bak", te.Data.Conf_Backup == 1 ? 0 : FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI);
700+
const hr = MainWindow.RunEvent3("SafeReplaceFile", path);
701+
if (isFinite(hr)) {
702+
return hr;
703+
}
704+
if (te.Data.Conf_BAK) {
705+
if (api.ReplaceFile(path, path + ".tmp", path + ".bak", REPLACEFILE_WRITE_THROUGH)) {
706+
if (te.Data.Conf_BAK > 1) {
707+
DeleteItem(
708+
path + ".bak", FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI
709+
);
710+
}
711+
return;
712+
}
713+
if (api.PathFileExists(path)) {
714+
return;
703715
}
704-
} else if (!api.PathFileExists(path)) {
705-
api.MoveFileEx(path + ".tmp", path, MOVEFILE_WRITE_THROUGH);
706716
}
717+
api.MoveFileEx(path + ".tmp", path, MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH);
707718
}
708719

709720
SaveXmlTC = function (Ctrl, xml, nGroup) {

0 commit comments

Comments
 (0)