fix(win-clean): Chinese UI and normalize ClawX paths (#76)
This commit is contained in:
committed by
GitHub
Unverified
parent
e8915831dc
commit
4e386ffc37
@@ -2,18 +2,34 @@
|
|||||||
; Provides a "Complete Removal" option during uninstallation
|
; Provides a "Complete Removal" option during uninstallation
|
||||||
; to delete .openclaw config and AppData resources.
|
; to delete .openclaw config and AppData resources.
|
||||||
; Handles both per-user and per-machine (all users) installations.
|
; Handles both per-user and per-machine (all users) installations.
|
||||||
|
; Supports Chinese (Simplified/Traditional) and English UI.
|
||||||
|
|
||||||
!macro customUnInstall
|
!macro customUnInstall
|
||||||
; Ask user if they want to completely remove all user data
|
; Detect language: Chinese Simplified (2052), Chinese Traditional (1028)
|
||||||
|
; $LANGUAGE is set by the NSIS installer/uninstaller language selection.
|
||||||
|
StrCmp $LANGUAGE "2052" _cu_useChinese
|
||||||
|
StrCmp $LANGUAGE "1028" _cu_useChinese
|
||||||
|
|
||||||
|
; --- English message (default) ---
|
||||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||||
"Do you want to completely remove all ClawX user data?$\r$\n$\r$\nThis will delete:$\r$\n • .openclaw folder (configuration & skills)$\r$\n • AppData\Local\ClawX (local app data)$\r$\n • AppData\Roaming\ClawX (roaming app data)$\r$\n$\r$\nSelect 'No' to keep your data for future reinstallation." \
|
"Do you want to completely remove all ClawX user data?$\r$\n$\r$\nThis will delete:$\r$\n • .openclaw folder (configuration & skills)$\r$\n • AppData\Local\clawx (local app data)$\r$\n • AppData\Roaming\clawx (roaming app data)$\r$\n$\r$\nSelect 'No' to keep your data for future reinstallation." \
|
||||||
/SD IDNO IDYES _cu_removeData IDNO _cu_skipRemove
|
/SD IDNO IDYES _cu_removeData IDNO _cu_skipRemove
|
||||||
|
Goto _cu_afterPrompt
|
||||||
|
|
||||||
|
; --- Chinese message ---
|
||||||
|
_cu_useChinese:
|
||||||
|
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||||
|
"是否完全移除所有 ClawX 用户数据?$\r$\n$\r$\n将删除以下内容:$\r$\n • .openclaw 文件夹(配置和技能)$\r$\n • AppData\Local\clawx(本地应用数据)$\r$\n • AppData\Roaming\clawx(漫游应用数据)$\r$\n$\r$\n选择"否"可保留数据以便将来重新安装。" \
|
||||||
|
/SD IDNO IDYES _cu_removeData IDNO _cu_skipRemove
|
||||||
|
|
||||||
|
_cu_afterPrompt:
|
||||||
|
Goto _cu_skipRemove
|
||||||
|
|
||||||
_cu_removeData:
|
_cu_removeData:
|
||||||
; --- Always remove current user's data first ---
|
; --- Always remove current user's data first ---
|
||||||
RMDir /r "$PROFILE\.openclaw"
|
RMDir /r "$PROFILE\.openclaw"
|
||||||
RMDir /r "$LOCALAPPDATA\ClawX"
|
RMDir /r "$LOCALAPPDATA\clawx"
|
||||||
RMDir /r "$APPDATA\ClawX"
|
RMDir /r "$APPDATA\clawx"
|
||||||
|
|
||||||
; --- For per-machine (all users) installs, enumerate all user profiles ---
|
; --- For per-machine (all users) installs, enumerate all user profiles ---
|
||||||
; Registry key HKLM\...\ProfileList contains a subkey for each user SID.
|
; Registry key HKLM\...\ProfileList contains a subkey for each user SID.
|
||||||
@@ -43,8 +59,8 @@
|
|||||||
|
|
||||||
; Remove .openclaw and AppData for this user profile
|
; Remove .openclaw and AppData for this user profile
|
||||||
RMDir /r "$R2\.openclaw"
|
RMDir /r "$R2\.openclaw"
|
||||||
RMDir /r "$R2\AppData\Local\ClawX"
|
RMDir /r "$R2\AppData\Local\clawx"
|
||||||
RMDir /r "$R2\AppData\Roaming\ClawX"
|
RMDir /r "$R2\AppData\Roaming\clawx"
|
||||||
|
|
||||||
_cu_enumNext:
|
_cu_enumNext:
|
||||||
IntOp $R0 $R0 + 1
|
IntOp $R0 $R0 + 1
|
||||||
|
|||||||
Reference in New Issue
Block a user