Files
.github
script
checkVersion.cjs
debug-gc.ps1
gen-version.ts
napcat-custom.bat
napcat-log.ps1
napcat-utf8.bat
napcat-utf8.ps1
napcat.bat
napcat.ps1
napcat.sh
src
.editorconfig
.env.development
.env.production
.eslintrc.cjs
.gitignore
.gitmodules
CHANGELOG.md
LICENSE
README.md
logo.png
package.json
tsconfig.json
vite.config.ts
NapCatQQ/script/napcat-log.ps1
linyuchen 14e6c6d9a6 NapCatQQ
2024-04-15 00:09:08 +08:00

18 lines
712 B
PowerShell

function Get-QQpath {
try {
$key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ"
$uninstallString = $key.UninstallString
return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe"
}
catch {
return "D:\QQ.exe"
}
}
$params = $args -join " "
$QQpath = Get-QQpath
$Bootfile = Join-Path $PSScriptRoot "napcat.cjs"
$env:ELECTRON_RUN_AS_NODE = 1
$argumentList = '-noexit', '-noprofile', "-command `"$QQpath`" `"$Bootfile`" $params"
Start-Process powershell -ArgumentList $argumentList -RedirectStandardOutput "log.txt" -RedirectStandardError "error.txt"
powershell Get-Content -Wait -Encoding UTF8 log.txt