mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-06-13 09:43:50 +08:00
feat: update application name and paths to reflect new branding
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
appId: "store.spark-app.apm"
|
||||
asar: true
|
||||
productName: "apm-app-store"
|
||||
artifactName: "apm-app-store_${version}_${os}_${arch}.${ext}"
|
||||
productName: "apm-store"
|
||||
artifactName: "apm-store_${version}_${os}_${arch}.${ext}"
|
||||
directories:
|
||||
output: "release/${version}"
|
||||
files:
|
||||
@@ -17,7 +17,7 @@ extraResources:
|
||||
linux:
|
||||
icon: "icons/amber-pm-logo.icns"
|
||||
category: "System"
|
||||
executableName: "apm-app-store"
|
||||
executableName: "apm-store"
|
||||
desktop:
|
||||
entry:
|
||||
Name: "APM AppStore"
|
||||
|
||||
@@ -16,6 +16,8 @@ type InstallTask = {
|
||||
webContents: WebContents | null;
|
||||
};
|
||||
|
||||
const SHELL_CALLER_PATH = '/opt/apm-store/extras/shell-caller.sh';
|
||||
|
||||
const tasks = new Map<number, InstallTask>();
|
||||
|
||||
let idle = true; // Indicates if the installation manager is idle
|
||||
@@ -153,9 +155,9 @@ ipcMain.on('queue-install', async (event, download_json) => {
|
||||
let execParams = [];
|
||||
if (superUserCmd.length > 0) {
|
||||
execCommand = superUserCmd;
|
||||
execParams.push('/opt/apm-app-store/extras/shell-caller.sh');
|
||||
execParams.push(SHELL_CALLER_PATH);
|
||||
} else {
|
||||
execCommand = '/opt/apm-app-store/extras/shell-caller.sh';
|
||||
execCommand = SHELL_CALLER_PATH;
|
||||
}
|
||||
execParams.push('apm', 'install', '-y', pkgname);
|
||||
|
||||
@@ -254,7 +256,7 @@ ipcMain.handle('check-installed', async (_event, pkgname: string) => {
|
||||
|
||||
logger.info(`检查应用是否已安装: ${pkgname}`);
|
||||
|
||||
let child = spawn('/opt/apm-app-store/extras/shell-caller.sh', ['apm', 'list', '--installed', pkgname], {
|
||||
let child = spawn(SHELL_CALLER_PATH, ['apm', 'list', '--installed', pkgname], {
|
||||
shell: true,
|
||||
env: process.env
|
||||
});
|
||||
@@ -292,9 +294,9 @@ ipcMain.on('remove-installed', async (_event, pkgname: string) => {
|
||||
let execParams = [];
|
||||
if (superUserCmd.length > 0) {
|
||||
execCommand = superUserCmd;
|
||||
execParams.push('/opt/apm-app-store/extras/shell-caller.sh');
|
||||
execParams.push(SHELL_CALLER_PATH);
|
||||
} else {
|
||||
execCommand = '/opt/apm-app-store/extras/shell-caller.sh';
|
||||
execCommand = SHELL_CALLER_PATH;
|
||||
}
|
||||
let child = spawn(execCommand, [...execParams, 'apm', 'remove', '-y', pkgname], {
|
||||
shell: true,
|
||||
@@ -335,7 +337,7 @@ ipcMain.on('remove-installed', async (_event, pkgname: string) => {
|
||||
|
||||
ipcMain.handle('list-upgradable', async () => {
|
||||
const { code, stdout, stderr } = await runCommandCapture(
|
||||
'/opt/apm-app-store/extras/shell-caller.sh',
|
||||
SHELL_CALLER_PATH,
|
||||
['apm', 'list', '--upgradable']);
|
||||
if (code !== 0) {
|
||||
logger.error(`list-upgradable failed: ${stderr || stdout}`);
|
||||
@@ -352,9 +354,9 @@ ipcMain.handle('list-upgradable', async () => {
|
||||
|
||||
ipcMain.handle('list-installed', async () => {
|
||||
const superUserCmd = await checkSuperUserCommand();
|
||||
const execCommand = superUserCmd.length > 0 ? superUserCmd : '/opt/apm-app-store/extras/shell-caller.sh';
|
||||
const execCommand = superUserCmd.length > 0 ? superUserCmd : SHELL_CALLER_PATH;
|
||||
const execParams = superUserCmd.length > 0
|
||||
? ['/opt/apm-app-store/extras/shell-caller.sh', 'apm', 'list', '--installed']
|
||||
? [SHELL_CALLER_PATH, 'apm', 'list', '--installed']
|
||||
: ['apm', 'list', '--installed'];
|
||||
|
||||
const { code, stdout, stderr } = await runCommandCapture(execCommand, execParams);
|
||||
@@ -378,9 +380,9 @@ ipcMain.handle('uninstall-installed', async (_event, pkgname: string) => {
|
||||
}
|
||||
|
||||
const superUserCmd = await checkSuperUserCommand();
|
||||
const execCommand = superUserCmd.length > 0 ? superUserCmd : '/opt/apm-app-store/extras/shell-caller.sh';
|
||||
const execCommand = superUserCmd.length > 0 ? superUserCmd : SHELL_CALLER_PATH;
|
||||
const execParams = superUserCmd.length > 0
|
||||
? ['/opt/apm-app-store/extras/shell-caller.sh', 'apm', 'remove', '-y', pkgname]
|
||||
? [SHELL_CALLER_PATH, 'apm', 'remove', '-y', pkgname]
|
||||
: ['apm', 'remove', '-y', pkgname];
|
||||
|
||||
const { code, stdout, stderr } = await runCommandCapture(execCommand, execParams);
|
||||
@@ -404,7 +406,7 @@ ipcMain.handle('launch-app', async (_event, pkgname: string) => {
|
||||
}
|
||||
|
||||
const execCommand = 'dbus-launch';
|
||||
const execParams = ['/opt/apm-app-store/extras/apm-launcher', 'start', pkgname];
|
||||
const execParams = ['/opt/apm-store/extras/apm-launcher', 'start', pkgname];
|
||||
|
||||
await runCommandCapture(execCommand, execParams);
|
||||
});
|
||||
@@ -12,7 +12,7 @@
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/opt/apm-app-store/extras/shell-caller.sh</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/opt/apm-store/extras/shell-caller.sh</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
</policyconfig>
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "apm-app-store",
|
||||
"name": "apm-store",
|
||||
"version": "1.0.3-beta.1",
|
||||
"main": "dist-electron/main/index.js",
|
||||
"description": "Client for APM App Store",
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
cp -fv /opt/apm-app-store/extras/store.spark-app.amber-pm-store.policy /usr/share/polkit-1/actions/store.spark-app.amber-pm-store.policy
|
||||
xdg-mime default apm-app-store.desktop x-scheme-handler/apmstore
|
||||
cp -fv /opt/apm-store/extras/store.spark-app.amber-pm-store.policy /usr/share/polkit-1/actions/store.spark-app.amber-pm-store.policy
|
||||
xdg-mime default apm-store.desktop x-scheme-handler/apmstore
|
||||
update-mime-database /usr/share/mime || true
|
||||
Reference in New Issue
Block a user