mirror of
https://github.com/ValueCell-ai/ClawX.git
synced 2026-08-14 08:53:09 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b2948c960 | ||
|
|
31c183f050 | ||
|
|
56d18544e8 | ||
|
|
91fddb2cc8 |
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "clawx",
|
||||
"version": "0.1.22-alpha.2",
|
||||
"version": "0.1.22-alpha.4",
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"@whiskeysockets/baileys",
|
||||
|
||||
+43
-62
@@ -3,83 +3,64 @@
|
||||
; Install: enables long paths, adds resources\cli to user PATH for openclaw CLI.
|
||||
; Uninstall: removes the PATH entry and optionally deletes user data.
|
||||
|
||||
; When customCheckAppRunning is defined, electron-builder skips its conditional
|
||||
; !include for getProcessInfo.nsh and the "Var pid" declaration. We must do
|
||||
; both ourselves so ${GetProcessInfo} and $pid are available.
|
||||
!ifndef getProcessInfo_included
|
||||
!define getProcessInfo_included
|
||||
!include "getProcessInfo.nsh"
|
||||
Var pid
|
||||
!endif
|
||||
!ifndef nsProcess_included
|
||||
!define nsProcess_included
|
||||
!ifndef nsProcess::FindProcess
|
||||
!include "nsProcess.nsh"
|
||||
!endif
|
||||
|
||||
!macro customCheckAppRunning
|
||||
${GetProcessInfo} 0 $pid $1 $2 $3 $4
|
||||
${if} $3 != "${APP_EXECUTABLE_FILENAME}"
|
||||
${nsProcess::FindProcess} "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
|
||||
${if} $R0 == 0
|
||||
${if} ${isUpdated}
|
||||
# allow app to exit without explicit kill
|
||||
Sleep 300
|
||||
Sleep 1000
|
||||
Goto doStopProcess
|
||||
${endIf}
|
||||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(appRunning)" /SD IDOK IDOK doStopProcess
|
||||
Quit
|
||||
|
||||
# Instead of launching cmd.exe /c tasklist, use the nsProcess plugin directly for all environments.
|
||||
# This prevents the brief black cmd window from flashing.
|
||||
${nsProcess::FindProcess} "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
doStopProcess:
|
||||
DetailPrint `Closing running "${PRODUCT_NAME}"...`
|
||||
|
||||
${if} $R0 == 0
|
||||
${if} ${isUpdated}
|
||||
# allow app to exit without explicit kill
|
||||
# Silently kill the process using nsProcess instead of taskkill / cmd.exe
|
||||
${nsProcess::KillProcess} "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
|
||||
# to ensure that files are not "in-use"
|
||||
Sleep 300
|
||||
|
||||
# Retry counter
|
||||
StrCpy $R1 0
|
||||
|
||||
loop:
|
||||
IntOp $R1 $R1 + 1
|
||||
|
||||
${nsProcess::FindProcess} "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
${if} $R0 == 0
|
||||
# wait to give a chance to exit gracefully
|
||||
Sleep 1000
|
||||
Goto doStopProcess
|
||||
${endIf}
|
||||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(appRunning)" /SD IDOK IDOK doStopProcess
|
||||
Quit
|
||||
|
||||
doStopProcess:
|
||||
DetailPrint `Closing running "${PRODUCT_NAME}"...`
|
||||
|
||||
# Silently kill the process using nsProcess instead of taskkill / cmd.exe
|
||||
${nsProcess::KillProcess} "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
|
||||
# to ensure that files are not "in-use"
|
||||
Sleep 300
|
||||
|
||||
# Retry counter
|
||||
StrCpy $R1 0
|
||||
|
||||
loop:
|
||||
IntOp $R1 $R1 + 1
|
||||
|
||||
${nsProcess::KillProcess} "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
|
||||
${nsProcess::FindProcess} "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
${if} $R0 == 0
|
||||
# wait to give a chance to exit gracefully
|
||||
Sleep 1000
|
||||
${nsProcess::KillProcess} "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
|
||||
${nsProcess::FindProcess} "${APP_EXECUTABLE_FILENAME}" $R0
|
||||
${If} $R0 == 0
|
||||
DetailPrint `Waiting for "${PRODUCT_NAME}" to close.`
|
||||
Sleep 2000
|
||||
${else}
|
||||
Goto not_running
|
||||
${endIf}
|
||||
${If} $R0 == 0
|
||||
DetailPrint `Waiting for "${PRODUCT_NAME}" to close.`
|
||||
Sleep 2000
|
||||
${else}
|
||||
Goto not_running
|
||||
${endIf}
|
||||
${else}
|
||||
Goto not_running
|
||||
${endIf}
|
||||
|
||||
# App likely running with elevated permissions.
|
||||
# Ask user to close it manually
|
||||
${if} $R1 > 1
|
||||
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(appCannotBeClosed)" /SD IDCANCEL IDRETRY loop
|
||||
Quit
|
||||
${else}
|
||||
Goto loop
|
||||
${endIf}
|
||||
not_running:
|
||||
nsProcess::Unload
|
||||
${endIf}
|
||||
# App likely running with elevated permissions.
|
||||
# Ask user to close it manually
|
||||
${if} $R1 > 1
|
||||
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(appCannotBeClosed)" /SD IDCANCEL IDRETRY loop
|
||||
Quit
|
||||
${else}
|
||||
Goto loop
|
||||
${endIf}
|
||||
not_running:
|
||||
${nsProcess::Unload}
|
||||
${endIf}
|
||||
!macroend
|
||||
|
||||
|
||||
@@ -948,7 +948,8 @@ function ProviderContent({
|
||||
|
||||
try {
|
||||
// Validate key if the provider requires one and a key was entered
|
||||
if (requiresKey && apiKey) {
|
||||
const isApiKeyRequired = requiresKey || (supportsApiKey && authMode === 'apikey');
|
||||
if (isApiKeyRequired && apiKey) {
|
||||
const result = await window.electron.ipcRenderer.invoke(
|
||||
'provider:validateKey',
|
||||
selectedProviderConfigId || selectedProvider,
|
||||
@@ -1024,9 +1025,10 @@ function ProviderContent({
|
||||
};
|
||||
|
||||
// Can the user submit?
|
||||
const isApiKeyRequired = requiresKey || (supportsApiKey && authMode === 'apikey');
|
||||
const canSubmit =
|
||||
selectedProvider
|
||||
&& (requiresKey ? apiKey.length > 0 : true)
|
||||
&& (isApiKeyRequired ? apiKey.length > 0 : true)
|
||||
&& (showModelIdField ? modelId.trim().length > 0 : true)
|
||||
&& !useOAuthFlow;
|
||||
|
||||
@@ -1197,7 +1199,7 @@ function ProviderContent({
|
||||
)}
|
||||
|
||||
{/* API Key field (hidden for ollama) */}
|
||||
{(!isOAuth || (supportsApiKey && authMode === 'apikey')) && requiresKey && (
|
||||
{(!isOAuth || (supportsApiKey && authMode === 'apikey')) && (
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="apiKey">{t('provider.apiKey')}</Label>
|
||||
<div className="relative">
|
||||
|
||||
Reference in New Issue
Block a user