Skip to content

Commit

Permalink
update windows icon clear cache method
Browse files Browse the repository at this point in the history
  • Loading branch information
HowcanoeWang committed Sep 17, 2023
1 parent 29c6598 commit a644dc2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "siyuan-genshin-launcher",
"version": "4.0.1",
"version": "4.0.2",
"description": "This is a plugin for changing the lanucher and lock screen to genshin style",
"main": ".src/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan-genshin-launcher",
"author": "HowcanoeWang",
"url": "https://github.com/HowcanoeWang/siyuan-genshin-launcher",
"version": "4.0.1",
"version": "4.0.2",
"minAppVersion": "2.10.2",
"backends": ["windows", "darwin"],
"frontends": ["desktop"],
Expand Down
13 changes: 11 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export default class PluginSample extends Plugin {
this.openSetting();
}, 3000);
}

// var userProfilePath = process.env.USERPROFILE;
// userProfilePath = userProfilePath .replaceAll('\\', '/');
// this.execudeCMD(`Remove-Item -Path '${userProfilePath}/AppData/Local/Microsoft/Windows/Explorer/iconcache_*.db' -Force;`)
}

onunload() {
Expand Down Expand Up @@ -257,8 +261,13 @@ export default class PluginSample extends Plugin {

public clearWinCache() {
if (this.os === 'windows') {
return `ie4uinit.exe -show;` +
`Get-Process -Name explorer | Stop-Process -Force;` + `Start-Process explorer`
var userProfilePath = process.env.USERPROFILE;
userProfilePath = userProfilePath .replaceAll('\\', '/');
return `attrib -h ${userProfilePath}/AppData/Local/Microsoft/Windows/Explorer/thumbcache_*.db;` +
`Remove-Item -Path '${userProfilePath}/AppData/Local/Microsoft/Windows/Explorer/thumbcache_*.db' -Force;` +
`attrib -h ${userProfilePath}/AppData/Local/Microsoft/Windows/Explorer/iconcache_*.db;` +
`Remove-Item -Path '${userProfilePath}/AppData/Local/Microsoft/Windows/Explorer/iconcache_*.db' -Force;` +
`Get-Process -Name explorer | Stop-Process -Force;`
}
}

Expand Down

0 comments on commit a644dc2

Please sign in to comment.