diff --git a/LICENSE b/LICENSE index ecffc92..6775901 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) Alex Devero (alexdevero.com) +Copyright (c) Robert Nasarek (rnsrk.de) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/main.js b/main.js index 0a20894..1429c87 100644 --- a/main.js +++ b/main.js @@ -19,9 +19,10 @@ let trayMenu = Menu.buildFromTemplate([ } }, { - label: 'Schließen', + label: 'Beenden', click: function(){ mainWindow.close() + app.quit() } } ]) @@ -30,6 +31,9 @@ function createTray() { tray = new Tray('./resources/files/images/marvin16x16.png'); tray.setToolTip('Marvin') tray.setContextMenu(trayMenu); + tray.on('click', function() { + tray.popUpContextMenu(); + }) } // Keep a reference for dev mode @@ -198,6 +202,7 @@ function createWindow(dimensions) { // Don't show until we are ready and loaded mainWindow.once('ready-to-show', () => { + mainWindow.show() // Open the DevTools automatically if developing if (dev) { diff --git a/marvin256x256.ico b/marvin256x256.ico new file mode 100644 index 0000000..c07695f Binary files /dev/null and b/marvin256x256.ico differ diff --git a/package.json b/package.json index 9eca952..3fe99d2 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,26 @@ "prod": "cross-env NODE_ENV=production webpack --mode production --config webpack.build.config.js && electron --noDevServer .", "start": "cross-env NODE_ENV=development webpack serve --hot --host 0.0.0.0 --config=./webpack.dev.config.js --mode development", "build": "cross-env NODE_ENV=production webpack --config webpack.build.config.js --mode production", + "installer": "electron-builder", "package": "npm run build", "postpackage": "electron-packager ./ --ignore 'resources/files' --out=./builds --asar --overwrite --platform win32,linux --icon marvin.ico --extra-resource 'resources/files'" }, + "build": { + "appId": "marvin", + "win": { + "target": [ + "nsis" + ], + "icon": "marvin256x256.ico" + }, + "nsis": { + "oneClick": false, + "installerIcon": "marvin.ico", + "uninstallerIcon": "marvin.ico", + "uninstallDisplayName": "Marvin-Uninstaller", + "allowToChangeInstallationDirectory": true + } + }, "dependencies": { "@emotion/react": "^11.10.0", "@emotion/styled": "^11.10.0", @@ -61,8 +78,11 @@ "cross-env": "^7.0.3", "css-loader": "^6.7.1", "electron": "^20.0.3", + "electron-builder": "^23.3.3", "electron-devtools-installer": "^3.2.0", "electron-packager": "^15.5.1", + "electron-squirrel-startup": "^1.0.0", + "electron-winstaller": "^5.0.0", "file-loader": "^6.2.0", "html-webpack-plugin": "^5.5.0", "mini-css-extract-plugin": "^2.6.1", diff --git a/resources/files/config/config.json b/resources/files/config/config.json index b0b532a..4ca2d73 100644 --- a/resources/files/config/config.json +++ b/resources/files/config/config.json @@ -1,3 +1,3 @@ { - "rootDir": "/home/rbrt/Schreibtisch/marvin" + "rootDir": "C:\\Users\\Robert\\Desktop\\marvin" } \ No newline at end of file diff --git a/src/DocxInserter.js b/src/DocxInserter.js index acd0c96..c20e80f 100644 --- a/src/DocxInserter.js +++ b/src/DocxInserter.js @@ -92,9 +92,10 @@ export async function fillTemplate(log, objectData) { // Write document to disk. if (buffer) { + const normCharacterObjectId = replaceSpecialCharacters(objectData.inventarnummer) const normCharacterTitle = replaceSpecialCharacters(objectData.titel) const normSpacingTitle = normCharacterTitle.replace(/[^A-Z0-9]+/ig, "_"); - const filename = objectData.datum + '_' + normSpacingTitle + '.docx' + const filename = objectData.datum + '_' + normCharacterObjectId + '_' + normSpacingTitle + '.docx' fs.writeFileSync(path.join(documentPath, filename), buffer) log = { ...log, diff --git a/src/marvin256x256.ico b/src/marvin256x256.ico new file mode 100644 index 0000000..c07695f Binary files /dev/null and b/src/marvin256x256.ico differ diff --git a/src/routes/settings.js b/src/routes/settings.js index 48aef96..e2f62c0 100644 --- a/src/routes/settings.js +++ b/src/routes/settings.js @@ -1,5 +1,5 @@ // Config -import configImport from '/home/rbrt/WebstormProjects/marvin/resources/files/config/config.json' +import configImport from '/resources/files/config/config.json' // Components import {Log} from "../components/Log";