update powershell file for windows

This commit is contained in:
Tlntin
2023-03-08 12:04:14 +08:00
parent f14bbc52b7
commit db9b6629bc
3 changed files with 11 additions and 7 deletions

4
script/build.ps1 vendored
View File

@@ -28,7 +28,6 @@ $windows_conf_path = "src-tauri/tauri.windows.conf.json"
$total = $total - 1 $total = $total - 1
# for windows, we need replace package name to title # for windows, we need replace package name to title
# .\script\sd.exe "\"productName\": \"weread\"" "\"productName\": \"WeRead\"" src-tauri\tauri.conf.json
ForEach ($line in (Get-Content -Path .\app.csv | Select-Object -Skip 1)) { ForEach ($line in (Get-Content -Path .\app.csv | Select-Object -Skip 1)) {
$name, $title, $name_zh, $url = $line.Split(",") $name, $title, $name_zh, $url = $line.Split(",")
Write-Host "building package ${index}/${total}" Write-Host "building package ${index}/${total}"
@@ -48,7 +47,8 @@ ForEach ($line in (Get-Content -Path .\app.csv | Select-Object -Skip 1)) {
# replace package name # replace package name
# clear package_name with regex # clear package_name with regex
(Get-Content -Path $common_conf_path -Raw) -replace '"productName":\s*"[^"]*"', '"productName": ""' | Set-Content -Path $common_conf_path .\script\sd.exe "`"productName`":\s`"(.*?)`"" '"productName": ""' $common_conf_path
# (Get-Content -Path $common_conf_path -Raw) -replace '"productName":\s*"[^"]*"', '"productName": ""' | Set-Content -Path $common_conf_path
# replace package_name with no regex # replace package_name with no regex
.\script\sd.exe -s '"productName": ""' "`"productName`": `"$title`"" $common_conf_path .\script\sd.exe -s '"productName": ""' "`"productName`": `"$title`"" $common_conf_path

View File

@@ -1,12 +1,12 @@
{ {
"package": { "package": {
"productName": "WeRead", "productName": "",
"version": "1.0.0" "version": "1.0.0"
}, },
"tauri": { "tauri": {
"windows": [ "windows": [
{ {
"url": "", "url": "https://riju.codes/",
"transparent": true, "transparent": true,
"fullscreen": false, "fullscreen": false,
"width": 1200, "width": 1200,
@@ -29,3 +29,4 @@
} }
} }

View File

@@ -1,14 +1,14 @@
{ {
"tauri": { "tauri": {
"bundle": { "bundle": {
"icon": ["png/weread_256.ico", "png/weread_32.ico"], "icon": ["png/coderunner_256.ico", "png/coderunner_32.ico"],
"identifier": "com.tw93.weread", "identifier": "com.tw93.coderunner",
"active": true, "active": true,
"category": "DeveloperTool", "category": "DeveloperTool",
"copyright": "", "copyright": "",
"externalBin": [], "externalBin": [],
"longDescription": "", "longDescription": "",
"resources": ["png/weread_32.ico"], "resources": ["png/coderunner_32.ico"],
"shortDescription": "", "shortDescription": "",
"targets": ["msi"], "targets": ["msi"],
"windows": { "windows": {
@@ -23,3 +23,6 @@
} }
} }
} }