From ab6d07d4bdc0679f748c7a4249f40d0b046b3ce4 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Sun, 4 Jun 2023 15:43:21 +0200 Subject: [PATCH] add independent packaging scripts --- README.md | 8 +++---- frontend/src/upscalingHandler.js | 3 +++ frontend/src/views/HomeView.vue | 14 +++++++----- packaging/package.sh | 22 +++++++++++-------- packaging/packageLinux.sh | 37 ++++++++++++++++++++++++++++++++ packaging/packageWindows.sh | 37 ++++++++++++++++++++++++++++++++ 6 files changed, 103 insertions(+), 18 deletions(-) create mode 100755 packaging/packageLinux.sh create mode 100755 packaging/packageWindows.sh diff --git a/README.md b/README.md index 9b5a725..be2d82a 100755 --- a/README.md +++ b/README.md @@ -59,20 +59,20 @@ This App also features a CLI interface (reference out of date). # Contributing If you have any suggestions or features you'd like to have implemented, you may either implement the feature yourself and open a pull request, or open an issue on this GitHub page. Both things are appreciated! -*I am looking for somebody willing to maintain the Windows version (including installer) as I am running Linux* --> Follow the rules layed out in CONTRIBUTING.md --> We will add a linter that will then run on circleci to ensure code quality is high ### Current Contributers - simplePCBuilding (Maintainer) [Core (CLI), Docs, Website, Frontend, Linux packages] -- ThatPlasma (Testing, Packager) [Testing, Windows Package] +- ThatPlasma (Testing, Packager) [Testing] # Roadmap V2.0.0: -- Migrate to Electron app -- Package Windows & Linux Version +- Migrate to Electron app -- ✅ +- Package Windows & Linux Version -- ✅ +- Add packaging script for Linux & Windows version -- ✅ - Make python app CLI only -- ✅ - Refactor backend to add plugin support -- ✅ diff --git a/frontend/src/upscalingHandler.js b/frontend/src/upscalingHandler.js index 63050c5..b3e0ed2 100644 --- a/frontend/src/upscalingHandler.js +++ b/frontend/src/upscalingHandler.js @@ -39,6 +39,8 @@ class UpscalingHandler { // add additional options // baseCommand += + ' -S ' + options.sharpening // baseCommand += ' -E ' + options.engine + ' -M ' + options.algorithm + + console.log( 'upscaling' ); let child = child_process.spawn( baseCommand, args ); @@ -52,6 +54,7 @@ class UpscalingHandler { } ); child.on( 'error', ( error ) => { + console.log( 'An error occurred' + error ); new Notification( { title: `ImageVideoUpscaler - Error whilst upscaling', body: 'Your upscaling Job encountered an error whilst upscaling. (Error message: ${ error.message }).`} ) } ); diff --git a/frontend/src/views/HomeView.vue b/frontend/src/views/HomeView.vue index 30b3bfb..490f640 100644 --- a/frontend/src/views/HomeView.vue +++ b/frontend/src/views/HomeView.vue @@ -12,11 +12,15 @@
-
- x
+
+
+ x
+
-
-
+
+
+
+


@@ -68,7 +72,7 @@ export default { data() { return { upscaleSettings: { 'engine': 'ffc', 'algorithm': 'fsr', 'scale': 2, 'sharpening': 0, 'InputFile': [ '/home/janis/projects/myevent/assets/logo.png' ], 'OutputFile': '/home/janis/Downloads/test.png' }, - engines: { 'ffc':{ 'displayName': 'FidelityFX CLI', 'id': 'ffc', 'modes': { 'fsr': { 'displayName': 'FidelityFX Super Resolution', 'id': 'fsr' } }, 'supports': [ 'upscaling', 'sharpening' ] }, 'ss':{ 'displayName': 'REAL-ESGRAN', 'id': 'ss' } }, + engines: { 'ffc':{ 'displayName': 'FidelityFX CLI', 'id': 'ffc', 'modes': { 'fsr': { 'displayName': 'FidelityFX Super Resolution', 'id': 'fsr' }, 'c': { 'displayName': 'Cubic', 'id': 'c' }, 'hqc': { 'displayName': 'High Quality Cubic', 'id': 'hqc' } }, 'supports': [ 'upscaling', 'sharpening' ] }, 'ss':{ 'displayName': 'REAL-ESRGAN', 'id': 'ss', 'modes': { 'av3': { 'displayName': 'realesr-animevideov3', 'id': 'av3' }, 'x4plus': { 'displayName': 'realesrgan-x4plus-anime', 'id': 'x4plus' } }, 'supports': [ 'upscaling' ] } }, fixed: false, output: '', } diff --git a/packaging/package.sh b/packaging/package.sh index 2b41b49..94d49ad 100755 --- a/packaging/package.sh +++ b/packaging/package.sh @@ -4,15 +4,15 @@ cd .. # Compile for Linux pyinstaller imagevideoupscaler.spec -cp -r ./dist/imagevideoupscaler/* ./frontend/ +cp -rv ./dist/imagevideoupscaler/* ./frontend/ # Copy python files -cp -r ./bin ./frontend/ -cp -r ./config ./frontend/ -cp ./imagevideoupscaler-cli.py ./frontend/ -cp ./LICENSE ./frontend/ -cp ./logo.png ./frontend/ +cp -rv ./bin ./frontend/ +cp -rv ./config ./frontend/ +cp -v ./imagevideoupscaler-cli.py ./frontend/ +cp -v ./LICENSE ./frontend/ +cp -v ./logo.png ./frontend/ # package for Linux (includes GUI & CLI) @@ -34,8 +34,8 @@ printf '\n\n==> Finished Linux packaging, preparing Windows\n\n' # Compile for Windows wine python -m PyInstaller imagevideoupscaler.spec -cp -r ./dist/imagevideoupscaler/* ./frontend/ - +cp -rv ./dist/imagevideoupscaler/* ./frontend/ +cp -v ./imagevideoupscaler-cli.py ./frontend/ # package for Windows (includes GUI & CLI) cd frontend @@ -46,7 +46,11 @@ rm -rf ./config rm -rf ./lib-dynload rm ./image* rm ./_* -rm ./imagevideoupscaler-cli.py +rm ./py* +rm ./lib* +rm ./base_library.zip +rm ./*.pyd +rm ./*.dll rm ./LICENSE cd .. diff --git a/packaging/packageLinux.sh b/packaging/packageLinux.sh new file mode 100755 index 0000000..a6dbb1c --- /dev/null +++ b/packaging/packageLinux.sh @@ -0,0 +1,37 @@ +#! /bin/bash + +cd .. + +# Compile for Linux +pyinstaller imagevideoupscaler.spec +cp -r ./dist/imagevideoupscaler/* ./frontend/ + + +# Copy python files +cp -r ./bin ./frontend/ +cp -r ./config ./frontend/ +cp ./imagevideoupscaler-cli.py ./frontend/ +cp ./LICENSE ./frontend/ +cp ./logo.png ./frontend/ + + +# package for Linux (includes GUI & CLI) +cd frontend +npm run electron:build -- --linux deb rpm + +rm -rf ./bin +rm -rf ./config +rm -rf ./libdynload +rm ./image* +rm ./lib* +rm ./ld* +rm ./base_library.zip +rm ./imagevideoupscaler-cli.py +rm ./LICENSE + +cd .. + +rm -rf ./build +rm -rf ./dist + +printf '\n\n==> DONE\n\n' \ No newline at end of file diff --git a/packaging/packageWindows.sh b/packaging/packageWindows.sh new file mode 100755 index 0000000..41c59cf --- /dev/null +++ b/packaging/packageWindows.sh @@ -0,0 +1,37 @@ +#! /bin/bash + +cd .. + +# Compile for Windows +wine python -m PyInstaller imagevideoupscaler.spec +cp -r ./dist/imagevideoupscaler/* ./frontend/ + +# Copy python files +cp -rv ./bin ./frontend/ +cp -rv ./config ./frontend/ +cp -v ./imagevideoupscaler-cli.py ./frontend/ +cp -v ./LICENSE ./frontend/ +cp -v ./logo.png ./frontend/ + +# package for Windows (includes GUI & CLI) +cd frontend +npm run electron:build -- --win nsis + +rm -rf ./bin +rm -rf ./config +rm -rf ./lib-dynload +rm ./image* +rm ./_* +rm ./py* +rm ./lib* +rm ./base_library.zip +rm ./*.pyd +rm ./*.dll +rm ./LICENSE + +cd .. + +rm -rf ./build +rm -rf ./dist + +printf '\n\n==> DONE\n\n' \ No newline at end of file