diff --git a/config/main.webpack.config.ts b/config/main.webpack.config.ts index 0dfc5816..45265e43 100644 --- a/config/main.webpack.config.ts +++ b/config/main.webpack.config.ts @@ -82,7 +82,7 @@ const mainConfig: webpack.Configuration = { ), new CopyWebpackPlugin([ { - from: 'ucap-webmessenger-electron/resources/**/*', + from: 'ucap-webmessenger-electron/assets/**/*', to: path.resolve(__dirname, '..', 'dist'), context: 'electron-projects' } diff --git a/electron-builder.json b/electron-builder.json index f2a3c68c..d8f9c721 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -23,9 +23,25 @@ "!**/.awcache", "!**/.vscode", "!config/", + "!dist/", "!docker/", "!tsconfig.json", - "!tslint.json" + "!tslint.json", + { + "filter": ["**/*"], + "from": "./dist/ucap-webmessenger-app/", + "to": "./renderer/" + }, + { + "filter": ["**/*"], + "from": "./dist/ucap-webmessenger-electron/", + "to": "./electron/" + }, + { + "filter": ["**/*"], + "from": "./config/build/${os}/icon/daesang/", + "to": "./assets/icon/" + } ], "protocols": { "name": "DS Talk", diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/128_128.png b/electron-projects/ucap-webmessenger-electron/assets/image/128_128.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/128_128.png rename to electron-projects/ucap-webmessenger-electron/assets/image/128_128.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/16_16.png b/electron-projects/ucap-webmessenger-electron/assets/image/16_16.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/16_16.png rename to electron-projects/ucap-webmessenger-electron/assets/image/16_16.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/256_256.png b/electron-projects/ucap-webmessenger-electron/assets/image/256_256.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/256_256.png rename to electron-projects/ucap-webmessenger-electron/assets/image/256_256.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/32_32.png b/electron-projects/ucap-webmessenger-electron/assets/image/32_32.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/32_32.png rename to electron-projects/ucap-webmessenger-electron/assets/image/32_32.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/48_48.png b/electron-projects/ucap-webmessenger-electron/assets/image/48_48.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/48_48.png rename to electron-projects/ucap-webmessenger-electron/assets/image/48_48.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/64_64.png b/electron-projects/ucap-webmessenger-electron/assets/image/64_64.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/64_64.png rename to electron-projects/ucap-webmessenger-electron/assets/image/64_64.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/ico_64_64.png b/electron-projects/ucap-webmessenger-electron/assets/image/ico_64_64.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/ico_64_64.png rename to electron-projects/ucap-webmessenger-electron/assets/image/ico_64_64.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/ico_64x64.ico b/electron-projects/ucap-webmessenger-electron/assets/image/ico_64x64.ico similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/ico_64x64.ico rename to electron-projects/ucap-webmessenger-electron/assets/image/ico_64x64.ico diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/ico_64x64_r.png b/electron-projects/ucap-webmessenger-electron/assets/image/ico_64x64_r.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/ico_64x64_r.png rename to electron-projects/ucap-webmessenger-electron/assets/image/ico_64x64_r.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/lgRed/128_128.png b/electron-projects/ucap-webmessenger-electron/assets/image/lgRed/128_128.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/lgRed/128_128.png rename to electron-projects/ucap-webmessenger-electron/assets/image/lgRed/128_128.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/lgRed/16_16.png b/electron-projects/ucap-webmessenger-electron/assets/image/lgRed/16_16.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/lgRed/16_16.png rename to electron-projects/ucap-webmessenger-electron/assets/image/lgRed/16_16.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/lgRed/256_256.png b/electron-projects/ucap-webmessenger-electron/assets/image/lgRed/256_256.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/lgRed/256_256.png rename to electron-projects/ucap-webmessenger-electron/assets/image/lgRed/256_256.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/lgRed/32_32.png b/electron-projects/ucap-webmessenger-electron/assets/image/lgRed/32_32.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/lgRed/32_32.png rename to electron-projects/ucap-webmessenger-electron/assets/image/lgRed/32_32.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/lgRed/48_48.png b/electron-projects/ucap-webmessenger-electron/assets/image/lgRed/48_48.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/lgRed/48_48.png rename to electron-projects/ucap-webmessenger-electron/assets/image/lgRed/48_48.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/lgRed/64_64.png b/electron-projects/ucap-webmessenger-electron/assets/image/lgRed/64_64.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/lgRed/64_64.png rename to electron-projects/ucap-webmessenger-electron/assets/image/lgRed/64_64.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/lgRed/ico_64_64.png b/electron-projects/ucap-webmessenger-electron/assets/image/lgRed/ico_64_64.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/lgRed/ico_64_64.png rename to electron-projects/ucap-webmessenger-electron/assets/image/lgRed/ico_64_64.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/image/lgRed/ico_64x64_r.png b/electron-projects/ucap-webmessenger-electron/assets/image/lgRed/ico_64x64_r.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/image/lgRed/ico_64x64_r.png rename to electron-projects/ucap-webmessenger-electron/assets/image/lgRed/ico_64x64_r.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/installer/woori.ico b/electron-projects/ucap-webmessenger-electron/assets/installer/woori.ico similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/installer/woori.ico rename to electron-projects/ucap-webmessenger-electron/assets/installer/woori.ico diff --git a/electron-projects/ucap-webmessenger-electron/resources/installer/woori_256x256.png b/electron-projects/ucap-webmessenger-electron/assets/installer/woori_256x256.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/installer/woori_256x256.png rename to electron-projects/ucap-webmessenger-electron/assets/installer/woori_256x256.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_message.png b/electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_call_message.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_message.png rename to electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_call_message.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_receive.png b/electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_call_receive.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_receive.png rename to electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_call_receive.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_refuse.png b/electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_call_refuse.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_refuse.png rename to electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_call_refuse.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_transfer.png b/electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_call_transfer.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_transfer.png rename to electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_call_transfer.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_close.png b/electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_close.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_close.png rename to electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_close.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_close_gray.png b/electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_close_gray.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_close_gray.png rename to electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_close_gray.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_noti_call.png b/electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_noti_call.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_noti_call.png rename to electron-projects/ucap-webmessenger-electron/assets/notification/images/btn_noti_call.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/images/img_nophoto_50.png b/electron-projects/ucap-webmessenger-electron/assets/notification/images/img_nophoto_50.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/images/img_nophoto_50.png rename to electron-projects/ucap-webmessenger-electron/assets/notification/images/img_nophoto_50.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/preload.js b/electron-projects/ucap-webmessenger-electron/assets/notification/preload.js similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/preload.js rename to electron-projects/ucap-webmessenger-electron/assets/notification/preload.js diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/sounds/messageAlarm.mp3 b/electron-projects/ucap-webmessenger-electron/assets/notification/sounds/messageAlarm.mp3 similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/sounds/messageAlarm.mp3 rename to electron-projects/ucap-webmessenger-electron/assets/notification/sounds/messageAlarm.mp3 diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/styles/noti_messege.css b/electron-projects/ucap-webmessenger-electron/assets/notification/styles/noti_messege.css similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/styles/noti_messege.css rename to electron-projects/ucap-webmessenger-electron/assets/notification/styles/noti_messege.css diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/template.html b/electron-projects/ucap-webmessenger-electron/assets/notification/template.html similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/template.html rename to electron-projects/ucap-webmessenger-electron/assets/notification/template.html diff --git a/electron-projects/ucap-webmessenger-electron/resources/update-window/images/btnimg_top_close.png b/electron-projects/ucap-webmessenger-electron/assets/update-window/images/btnimg_top_close.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/update-window/images/btnimg_top_close.png rename to electron-projects/ucap-webmessenger-electron/assets/update-window/images/btnimg_top_close.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/update-window/preload.js b/electron-projects/ucap-webmessenger-electron/assets/update-window/preload.js similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/update-window/preload.js rename to electron-projects/ucap-webmessenger-electron/assets/update-window/preload.js diff --git a/electron-projects/ucap-webmessenger-electron/resources/update-window/styles/update-window.css b/electron-projects/ucap-webmessenger-electron/assets/update-window/styles/update-window.css similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/update-window/styles/update-window.css rename to electron-projects/ucap-webmessenger-electron/assets/update-window/styles/update-window.css diff --git a/electron-projects/ucap-webmessenger-electron/resources/update-window/template.html b/electron-projects/ucap-webmessenger-electron/assets/update-window/template.html similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/update-window/template.html rename to electron-projects/ucap-webmessenger-electron/assets/update-window/template.html diff --git a/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts b/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts index f5502769..8b7abfae 100644 --- a/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts +++ b/electron-projects/ucap-webmessenger-electron/src/app/AppWindow.ts @@ -165,11 +165,7 @@ export class AppWindow { } else { this.window.loadURL( url.format({ - pathname: path.join( - __dirname, - '..', - 'ucap-webmessenger-app/index.html' - ), + pathname: path.join(__dirname, '..', 'renderer/index.html'), protocol: 'file:', slashes: true }) diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index 743a8007..d2a8a0e2 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -52,13 +52,18 @@ const appIconPath = __LINUX__ ? path.join( __dirname, '../../', - 'config/build/linux/icon/woori/', + 'config/build/linux/icon/daesang/', '256x256.png' ) - : path.join(__dirname, 'resources/linuxicon', '256x256.png') + : path.join(__dirname, '..', '/assets/icon/', '256x256.png') : __DEV__ - ? path.join(__dirname, 'resources/image', '64_64.png') - : path.join(__dirname, 'resources/image', '64_64.png'); + ? path.join( + __dirname, + '../../', + 'config/build/win/icon/daesang/', + '16x16.ico' + ) + : path.join(__dirname, '..', '/assets/icon/', '16x16.ico'); let appWindow: AppWindow | null = null; let appTray: Tray | null = null; @@ -266,12 +271,12 @@ app.on(ElectronAppChannel.Ready, () => { notificationService.options.defaultWindow.webPreferences.preload = path.join( __dirname, - 'resources/notification/preload.js' + 'assets/notification/preload.js' ); notificationService.templatePath = path.join( __dirname, - 'resources/notification/template.html' + 'assets/notification/template.html' ); updateWindowService = new ElectronUpdateWindowService({ @@ -299,7 +304,7 @@ app.on(ElectronAppChannel.Ready, () => { updateWindowService.templatePath = path.join( __dirname, - 'resources/update-window/template.html' + 'assets/update-window/template.html' ); // updateWindowService.show(); @@ -589,15 +594,12 @@ ipcMain.on( text: noti.contents, image: noti.image || - path.join( - __dirname, - 'resources/notification/images/img_nophoto_50.png' - ), + path.join(__dirname, 'assets/notification/images/img_nophoto_50.png'), sound: noti.useSound ? path.join( 'file://', __dirname, - 'resources/notification/sounds/messageAlarm.mp3' + 'assets/notification/sounds/messageAlarm.mp3' ) : '', displayTime: !!noti.displayTime ? noti.displayTime : undefined, diff --git a/electron-projects/ucap-webmessenger-electron/src/util/root.ts b/electron-projects/ucap-webmessenger-electron/src/util/root.ts index 32fdd3f6..ce534375 100644 --- a/electron-projects/ucap-webmessenger-electron/src/util/root.ts +++ b/electron-projects/ucap-webmessenger-electron/src/util/root.ts @@ -3,7 +3,7 @@ import * as path from 'path'; // tslint:disable-next-line: variable-name const _root = __DEV__ ? path.resolve(__dirname, '..', '..') - : path.resolve(__dirname, '..', '..'); + : path.resolve(__dirname, '..'); export function root(...paths: string[]) { const args = Array.prototype.slice.call(paths, 0); diff --git a/package.json b/package.json index 078d38a4..cb1df3fc 100644 --- a/package.json +++ b/package.json @@ -145,5 +145,5 @@ "webpack-node-externals": "^1.7.2", "zone.js": "~0.9.1" }, - "main": "./dist/ucap-webmessenger-electron/main.js" + "main": "./electron/main.js" } diff --git a/projects/ucap-webmessenger-app/src/app/app-translate.module.ts b/projects/ucap-webmessenger-app/src/app/app-translate.module.ts index 9034d687..531600ca 100644 --- a/projects/ucap-webmessenger-app/src/app/app-translate.module.ts +++ b/projects/ucap-webmessenger-app/src/app/app-translate.module.ts @@ -19,7 +19,7 @@ export function createTranslateLoader(nativeService: NativeService) { break; case NativeType.Electron: prefix = environment.production - ? '/dist/ucap-webmessenger-app/assets/i18n/' + ? '/renderer/assets/i18n/' : '/projects/ucap-webmessenger-app/src/assets/i18n/'; break;