fullcourtdefense-cli 1.22.4 → 1.22.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/windowsAudit.js +23 -2
- package/dist/version.json +1 -1
- package/package.json +1 -1
|
@@ -145,12 +145,33 @@ function auditPreInstallSnapshotPath() {
|
|
|
145
145
|
function captureAuditPreInstallSnapshot() {
|
|
146
146
|
try {
|
|
147
147
|
const file = auditPreInstallSnapshotPath();
|
|
148
|
-
|
|
148
|
+
const trDir = regString(TRANSCRIPTION_KEY, 'OutputDirectory');
|
|
149
|
+
// Upgrade guard: when transcription already points at OUR folder, the
|
|
150
|
+
// current keys are FCD's own configuration written by a pre-snapshot
|
|
151
|
+
// version (<=1.22.3) — NOT a pre-install state. Recording it would make
|
|
152
|
+
// uninstall "restore" FCD's keys instead of removing them. Skip the
|
|
153
|
+
// snapshot; uninstall's conservative heuristic handles FCD-provenance
|
|
154
|
+
// keys correctly.
|
|
155
|
+
const fcdProvenance = typeof trDir === 'string' && /FullCourtDefense/i.test(trDir);
|
|
156
|
+
if (fs.existsSync(file)) {
|
|
157
|
+
// Self-heal snapshots already written by 1.22.4.0 on upgraded machines:
|
|
158
|
+
// a "pre-install" transcription directory inside an FCD folder is
|
|
159
|
+
// provably bogus (FCD did not exist before FCD was installed).
|
|
160
|
+
try {
|
|
161
|
+
const existing = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
162
|
+
const dir = existing?.transcription?.outputDirectory;
|
|
163
|
+
if (typeof dir === 'string' && /FullCourtDefense/i.test(dir))
|
|
164
|
+
fs.unlinkSync(file);
|
|
165
|
+
}
|
|
166
|
+
catch { /* unreadable snapshot: leave it — the uninstall branch parses defensively */ }
|
|
167
|
+
if (fs.existsSync(file))
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (fcdProvenance)
|
|
149
171
|
return;
|
|
150
172
|
const sblValue = regDword(SBL_KEY, 'EnableScriptBlockLogging');
|
|
151
173
|
const trValue = regDword(TRANSCRIPTION_KEY, 'EnableTranscripting');
|
|
152
174
|
const trHeader = regDword(TRANSCRIPTION_KEY, 'EnableInvocationHeader');
|
|
153
|
-
const trDir = regString(TRANSCRIPTION_KEY, 'OutputDirectory');
|
|
154
175
|
const snapshot = {
|
|
155
176
|
capturedAt: new Date().toISOString(),
|
|
156
177
|
scriptBlockLogging: { present: sblValue !== undefined, enableValue: sblValue },
|
package/dist/version.json
CHANGED