diff --git a/bin/builders/LinuxBuilder.ts b/bin/builders/LinuxBuilder.ts index ed55ab9..cec50b1 100644 --- a/bin/builders/LinuxBuilder.ts +++ b/bin/builders/LinuxBuilder.ts @@ -46,21 +46,6 @@ export default class LinuxBuilder implements IBuilder { const { name } = options; await mergeTauriConfig(url, options, tauriConf); - // write desktop - const assertSrc = `src-tauri/assets/${name}.desktop`; - const assertPath = path.join(npmDirectory, assertSrc); - const desktopStr = ` -[Desktop Entry] -Encoding=UTF-8 -Categories=Office -Exec=${name} -Icon=${name} -Name=${name} -StartupNotify=true -Terminal=false -Type=Application - ` - await fs.writeFile(assertPath, desktopStr); const _ = await shellExec(`cd ${npmDirectory} && npm install && npm run build`); let arch = ""; if (process.arch === "x64") { diff --git a/bin/builders/common.ts b/bin/builders/common.ts index b3fab61..b081e35 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -58,25 +58,16 @@ export async function mergeTauriConfig( } } if (process.platform === "linux") { - tauriConf.package.productName = name.toLowerCase(); - if (customIconExt === ".png") { - const installSrc = `/usr/share/applications/${name.toLowerCase()}.desktop`; - const assertSrc = `src-tauri/assets/${name.toLowerCase()}.desktop`; - const assertPath = path.join(npmDirectory, assertSrc); - tauriConf.tauri.bundle.deb.files = { - [installSrc]: assertPath - } - } else { + delete tauriConf.tauri.bundle.deb.files; + if (customIconExt != ".png") { updateIconPath = false; logger.warn(`icon file in Linux must be 512 * 512 pix with .png type, but you give ${customIconExt}`); } } - if (process.platform === "darwin") { - if (customIconExt !== ".icns") { + if (process.platform === "darwin" && customIconExt !== ".icns") { updateIconPath = false; logger.warn(`icon file in MacOS must be .icns type, but you give ${customIconExt}`); - } } if (updateIconPath) { tauriConf.tauri.bundle.icon = [options.icon]; diff --git a/dist/cli.js b/dist/cli.js index 3197890..dfed20e 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -1653,25 +1653,15 @@ function mergeTauriConfig(url, options, tauriConf) { } } if (process.platform === "linux") { - tauriConf.package.productName = name.toLowerCase(); - if (customIconExt === ".png") { - const installSrc = `/usr/share/applications/${name.toLowerCase()}.desktop`; - const assertSrc = `src-tauri/assets/${name.toLowerCase()}.desktop`; - const assertPath = path.join(npmDirectory, assertSrc); - tauriConf.tauri.bundle.deb.files = { - [installSrc]: assertPath - }; - } - else { + delete tauriConf.tauri.bundle.deb.files; + if (customIconExt != ".png") { updateIconPath = false; logger.warn(`icon file in Linux must be 512 * 512 pix with .png type, but you give ${customIconExt}`); } } - if (process.platform === "darwin") { - if (customIconExt !== ".icns") { - updateIconPath = false; - logger.warn(`icon file in MacOS must be .icns type, but you give ${customIconExt}`); - } + if (process.platform === "darwin" && customIconExt !== ".icns") { + updateIconPath = false; + logger.warn(`icon file in MacOS must be .icns type, but you give ${customIconExt}`); } if (updateIconPath) { tauriConf.tauri.bundle.icon = [options.icon]; @@ -2133,21 +2123,6 @@ class LinuxBuilder { logger.debug('PakeAppOptions', options); const { name } = options; yield mergeTauriConfig(url, options, tauriConf); - // write desktop - const assertSrc = `src-tauri/assets/${name}.desktop`; - const assertPath = path.join(npmDirectory, assertSrc); - const desktopStr = ` -[Desktop Entry] -Encoding=UTF-8 -Categories=Office -Exec=${name} -Icon=${name} -Name=${name} -StartupNotify=true -Terminal=false -Type=Application - `; - yield fs.writeFile(assertPath, desktopStr); yield shellExec(`cd ${npmDirectory} && npm install && npm run build`); let arch = ""; if (process.arch === "x64") {