diff --git a/README.md b/README.md index 52ed7bc..e3ba185 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ - [📸 Ubuntu Preview](#-ubuntu-preview) - [💻 Developing Locally](#-developing-locally) - [📃 MIT License](#-mit-license) - - [*Disclaimer: Not affiliated with Microsoft*](#disclaimer-not-affiliated-with-microsoft) + - [*Disclaimer: Not affiliated with Microsoft. Office, the name, website, images/icons are the intellectual properties of Microsoft.*](#disclaimer-not-affiliated-with-microsoft-office-the-name-website-imagesicons-are-the-intellectual-properties-of-microsoft) # Introduction @@ -172,4 +172,4 @@ To build the app, run `yarn dist` # 📃 MIT License -#### *Disclaimer: Not affiliated with Microsoft* +#### *Disclaimer: Not affiliated with Microsoft. Office, the name, website, images/icons are the intellectual properties of Microsoft.* \ No newline at end of file diff --git a/assets/icons/download-fail.png b/assets/icons/download-fail.png new file mode 100644 index 0000000..ea7df3e Binary files /dev/null and b/assets/icons/download-fail.png differ diff --git a/assets/icons/download-success.png b/assets/icons/download-success.png new file mode 100644 index 0000000..118f65e Binary files /dev/null and b/assets/icons/download-success.png differ diff --git a/assets/icons/download.png b/assets/icons/download.png new file mode 100644 index 0000000..d538f87 Binary files /dev/null and b/assets/icons/download.png differ diff --git a/icon.icns b/assets/icons/icon.icns similarity index 100% rename from icon.icns rename to assets/icons/icon.icns diff --git a/icon.ico b/assets/icons/icon.ico similarity index 100% rename from icon.ico rename to assets/icons/icon.ico diff --git a/icon.png b/assets/icons/icon.png similarity index 100% rename from icon.png rename to assets/icons/icon.png diff --git a/build.sh b/build.sh index ebece2a..94e14f0 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,5 @@ #!/bin/bash +# This script helps you to start/build the MS-Office-Electron app if ! [ -x "$(command -v node)" ]; then echo 'Error: nodejs is not installed.' >&2 echo 'Installing nodejs now; this may take a while.' @@ -153,7 +154,7 @@ else echo 'Please install git manually.' fi fi - git clone --depth=1 https://github.com/agam778/MS-Office-Electron; cd MS-Office-Electron + git clone --depth=1 https://github.com/agam778/MS-Office-Electron; cd MS-Office-Electron || echo "Failed to change directory." && return 1 echo 'Cloned the repository' fi @@ -171,10 +172,10 @@ echo '1. Run the app' echo '2. Build the app' echo '3. Exit' echo 'Enter your choice:'; read choice; -if [ $choice -eq 1 ]; then +if [ "$choice" -eq "1" ]; then echo 'Running the app...' yarn start - elif [ $choice -eq 2 ]; then + elif [ "$choice" -eq "2" ]; then echo 'Building the app...' if [ "$(id -u)" != "0" ]; then if [ "$(uname -m)" == "arm64" ]; then @@ -189,7 +190,7 @@ if [ $choice -eq 1 ]; then yarn dist --x64 fi fi - elif [ $choice -eq 3 ]; then + elif [ "$choice" -eq "3" ]; then echo 'Exiting...' exit 1 fi diff --git a/MSlogo.svg b/docs/loading/MSlogo.svg similarity index 100% rename from MSlogo.svg rename to docs/loading/MSlogo.svg diff --git a/docs/loading/index.html b/docs/loading/index.html index 2eeedfa..3d0e1d1 100644 --- a/docs/loading/index.html +++ b/docs/loading/index.html @@ -15,9 +15,7 @@ diff --git a/icon2.png b/icon2.png deleted file mode 100644 index b0e14ee..0000000 Binary files a/icon2.png and /dev/null differ diff --git a/main.js b/main.js index 429d1df..e549a5b 100644 --- a/main.js +++ b/main.js @@ -21,6 +21,12 @@ console.log = log.log; ElectronDl({ dlPath: "./downloads", onStarted: (item) => { + BrowserWindow.getAllWindows().forEach((window) => { + window.setOverlayIcon( + __dirname + "/assets/icons/download.png", + "Downloading" + ); + }); dialog.showMessageBox({ type: "info", title: "Downloading File", @@ -29,12 +35,23 @@ ElectronDl({ }); }, onCompleted: () => { + BrowserWindow.getAllWindows().forEach((window) => { + window.setOverlayIcon( + __dirname + "/assets/icons/download-success.png", + "Download Successful" + ); + }); dialog.showMessageBox({ type: "info", title: "Download Completed", message: `Downloading Completed! Please check your "Downloads" folder.`, buttons: ["OK"], }); + setTimeout(() => { + BrowserWindow.getAllWindows().forEach((window) => { + window.setOverlayIcon(null, ""); + }); + }, 7000); }, onError: (item) => { dialog.showMessageBox({ @@ -43,6 +60,17 @@ ElectronDl({ message: `Downloading "${item.getFilename()}" failed :(`, buttons: ["OK"], }); + BrowserWindow.getAllWindows().forEach((window) => { + window.setOverlayIcon( + __dirname + "/download-fail.png", + "Download Failed" + ); + }); + setTimeout(() => { + BrowserWindow.getAllWindows().forEach((window) => { + window.setOverlayIcon(null, ""); + }); + }, 7000); }, }); @@ -78,9 +106,10 @@ const menulayout = [ click: () => openAboutWindow({ icon_path: - "https://github.com/agam778/MS-Office-Electron/blob/main/icon2.png?raw=true", + "https://raw.githubusercontent.com/agam778/MS-Office-Electron/main/assets/icons/icon.png", product_name: "MS Office - Electron", - copyright: "Copyright (c) 2021 Agampreet Singh Bajaj", + copyright: + "Copyright (c) 2022 Agampreet Singh\nOffice, the name, website, images/icons\nare the intellectual properties of Microsoft.", package_json_dir: __dirname, bug_report_url: "https://github.com/agam778/Microsoft-Office-Electron/issues/", @@ -358,13 +387,17 @@ Menu.setApplicationMenu(menu); function discordrpc(title) { if (store.get("discordrpcstatus") === "true") { - rpc.setActivity({ - details: `${title}`, - largeImageKey: "logo", - largeImageText: "MS-Office-Electron", - startTimestamp: Date.now(), - instance: false, - }); + rpc + .setActivity({ + details: `${title}`, + largeImageKey: "logo", + largeImageText: "MS-Office-Electron", + startTimestamp: Date.now(), + instance: false, + }) + .catch((err) => { + console.log(err); + }); } else { // don't do anything } @@ -372,20 +405,24 @@ function discordrpc(title) { function discordrpcupdate(title) { rpc.clearActivity(); - rpc.setActivity({ - details: `${title}`, - largeImageKey: "logo", - largeImageText: "MS-Office-Electron", - startTimestamp: Date.now(), - instance: false, - }); + rpc + .setActivity({ + details: `${title}`, + largeImageKey: "logo", + largeImageText: "MS-Office-Electron", + startTimestamp: Date.now(), + instance: false, + }) + .catch((err) => { + console.log(err); + }); } function createWindow() { const win = new BrowserWindow({ width: 1181, height: 670, - icon: path.join(__dirname, "/icon.png"), + icon: path.join(__dirname, "/assets/icons/icon.png"), show: false, webPreferences: { nodeIntegration: true, @@ -405,11 +442,11 @@ function createWindow() { transparent: true, frame: false, alwaysOnTop: true, - icon: "./icon.png", + icon: path.join(__dirname, "/assets/icons/icon.png"), }); splash.loadURL(`https://agam778.github.io/MS-Office-Electron/loading`); - win.loadURL("https://office.com/?auth=1", { + win.loadURL("https://www.office.com/?auth=1", { userAgent: "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36", }); diff --git a/package.json b/package.json index c149004..5b03e1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ms-office-electron", - "version": "0.5.1", + "version": "0.5.2", "description": "An Unofficial Microsoft Office Online Desktop Client. Free of Cost.", "main": "main.js", "repository": { @@ -9,9 +9,8 @@ }, "build": { "extraFiles": [ - "icon.png", - "LICENSE", - "icon2.png" + "/assets", + "LICENSE" ], "appId": "com.agampreet.ms-office-electron", "productName": "MS-Office-Electron", @@ -26,7 +25,7 @@ "Type": "Application", "Categories": "Office;" }, - "icon": "icon.png", + "icon": "./assets/icons/icon.png", "executableName": "MS-Office-Electron", "maintainer": "Agampreet Singh ", "target": [ @@ -43,7 +42,7 @@ "target": [ "dmg" ], - "icon": "icon.icns" + "icon": "./assets/icons/icon.icns" }, "nsis": { "oneClick": false, @@ -55,7 +54,7 @@ "target": [ "nsis" ], - "icon": "icon.ico" + "icon": "./assets/icons/icon.ico" }, "directories": { "output": "release" diff --git a/yarn.lock b/yarn.lock index 0de1701..45861a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -131,9 +131,9 @@ integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== "@types/keyv@*": - version "3.1.3" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.3.tgz#1c9aae32872ec1f20dcdaee89a9f3ba88f465e41" - integrity sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg== + version "3.1.4" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" + integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== dependencies: "@types/node" "*" @@ -188,9 +188,9 @@ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^17.0.1": - version "17.0.9" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.9.tgz#f1f931a4e5ae2c0134dea10f501088636a50b46a" - integrity sha512-Ci8+4/DOtkHRylcisKmVMtmVO5g7weUVCKcsu1sJvF1bn0wExTmbHmhFKj7AnEm0de800iovGhdSKzYnzbaHpg== + version "17.0.10" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.10.tgz#591522fce85d8739bca7b8bb90d048e4478d186a" + integrity sha512-gmEaFwpj/7f/ROdtIlci1R1VYU1J4j95m8T+Tj3iBgiBFKg1foE/PSl93bBd5T9LDXNPo8UlNN6W0qwD8O5OaA== dependencies: "@types/yargs-parser" "*" @@ -258,13 +258,6 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -531,16 +524,7 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.1.0, chalk@^4.1.1: +chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -597,13 +581,6 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -611,11 +588,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -740,9 +712,9 @@ debounce-fn@^4.0.0: mimic-fn "^3.0.0" debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" @@ -1036,11 +1008,6 @@ escape-goat@^2.0.0: resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" @@ -1270,11 +1237,6 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -1482,12 +1444,12 @@ isexe@^2.0.0: integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= jake@^10.6.1: - version "10.8.2" - resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.2.tgz#ebc9de8558160a66d82d0eadc6a2e58fbc500a7b" - integrity sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A== + version "10.8.4" + resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.4.tgz#f6a8b7bf90c6306f768aa82bb7b98bf4ca15e84a" + integrity sha512-MtWeTkl1qGsWUtbl/Jsca/8xSoK3x0UmS82sNbjqxxG/de/M/3b1DntdjHgPMC50enlTNwXOCRqPXLLt5cCfZA== dependencies: async "0.9.x" - chalk "^2.4.2" + chalk "^4.0.2" filelist "^1.0.1" minimatch "^3.0.4" @@ -2183,13 +2145,6 @@ sumchecker@^3.0.1: dependencies: debug "^4.1.0" -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -2433,9 +2388,9 @@ yargs-parser@^21.0.0: integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== yargs@^17.0.1: - version "17.3.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.3.1.tgz#da56b28f32e2fd45aefb402ed9c26f42be4c07b9" - integrity sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA== + version "17.4.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.0.tgz#9fc9efc96bd3aa2c1240446af28499f0e7593d00" + integrity sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA== dependencies: cliui "^7.0.2" escalade "^3.1.1"