How best to package files on base install directory of electron - package

I have been trying to make an electron app that relies on a third-party executable . Whenever I try bundling the app, the executable gets bundled with the rest of the app in asar format, making it impossible to access from outside the electron\node environent.
My question is how should I setup my environment or build config to achieve an installation where the third-party executable is on the root of the installed app?
PS: I am using electron-builder and a two-package.json format and I am getting a
successful build minus this caveat.
Here's my build config
"build": {
"appId": "com.toutici.asd",
"asar": true,
"directories": {
"app": "./app",
"buildResources": "./build",
"output": "./dist"
},
"electronDownload": {
"cache": ".electron",
"verifyChecksum": true
},
"electronVersion": "1.7.11",
"fileAssociations": {
"ext": "asd",
"icon": "./www/assets/icon/win/icon.ico"
},
"productName": "Android SMS Delimiter",
"mac": {
"category": "public.app-category.productivity",
"target": [
"dmg",
"mas"
],
"icon": "./build/icon.icns"
},
"dmg": {
"contents": [
{
"x": 110,
"y": 150
},
{
"x": 240,
"y": 150,
"type": "link",
"path": "/Applications"
}
]
},
"deb": {
"compression": "gz",
"icon": "./build/background.png"
},
"linux": {
"target": [
"AppImage",
"apk",
"deb",
"rpm",
"snap",
"tar.gz",
"zip"
]
},
"win": {
"target": [
{
"target": "nsis",
"arch": [
"ia32"
]
}
],
"icon": "build/icon.ico"
},
"nsis": {
"oneClick": true,
"perMachine": true,
"allowElevation": true,
"allowToChangeInstallationDirectory": false,
"createDesktopShortcut": true,
"runAfterFinish": true,
"installerIcon": "./build/icon.ico"
},
"portable": {
"requestExecutionLevel": "user"
},
"squirrelWindows": {
"iconUrl": "./build/icon.ico",
"loadingGif": "./build/install-spinner.gif",
"msi": true
}
}

Adding
extraFiles
config property to the electron-builder.json seems to solve the problem.
E.g.:
"extraFiles": [
{
"from": "../../CHANGELOG.md",
"to": "."
}
],
See also electron configuration docu: https://www.electron.build/configuration/contents#extrafiles

Related

How to disable the behaviour to remove the imports after commenting code in vscode

When I try to comment any code in my react project it's removing the dependent imports and that's getting hard for me to debug. How can I disable this behavior?
Any help is appreciated, Thanks in advance
Below is my settings.json for your reference. I have enabled some default auto settings as per my need which is been mentioned below JSON. let me know if I am missing something in JSON itself
{
"tabnine.experimentalAutoImports": true,
// "gitlens.mode.active": "zen",
"peacock.favoriteColors": [
{
"name": "Angular Red",
"value": "#dd0531"
},
{
"name": "Azure Blue",
"value": "#007fff"
},
{
"name": "JavaScript Yellow",
"value": "#f9e64f"
},
{
"name": "Mandalorian Blue",
"value": "#1857a4"
},
{
"name": "Node Green",
"value": "#215732"
},
{
"name": "React Blue",
"value": "#61dafb"
},
{
"name": "Something Different",
"value": "#832561"
},
{
"name": "Svelte Orange",
"value": "#ff3d00"
},
{
"name": "Vue Green",
"value": "#42b883"
}
],
"gitlens.hovers.currentLine.over": "line",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.updateImportsOnFileMove.enabled": "always",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"yaml.schemas": {
"file:///home/ravi/.vscode/extensions/atlassian.atlascode-2.10.1/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml"
},
"bracketPairColorizer.depreciation-notice": false,
"workbench.colorTheme": "Codey's in bed by 10",
"workbench.editorAssociations": {
"*.tgz": "default"
},
"javascript.updateImportsOnFileMove.enabled": "never",
"editor.fontFamily": "'Cascade Code', 'Fira Code'",
"editor.fontLigatures": true,
"files.autoSave": "afterDelay",
"git.confirmSync": false,
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"window.zoomLevel": 1,
"redhat.telemetry.enabled": true,
"files.saveConflictResolution": "overwriteFileOnDisk",
"html.format.indentInnerHtml": true,
"prettier.embeddedLanguageFormatting": "off",
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true,
"typescript.format.insertSpaceAfterTypeAssertion": true,
"eslint.codeActionsOnSave.mode": "problems",
"eslint.codeActionsOnSave.rules": null
}
You will probably have to remove this setting
"eslint.codeActionsOnSave.mode": "problems",
It basically say that on save eslint will try to fix all known problems, unused problems can be seen as a problem.

manual deployment getting an error "app.json must include a JSON object "

I was trying to do a manual deploy tody of my react-native project and I keep getting this error
[15:52:27] app.json must include a JSON object.
[15:52:27] Error: app.json must include a JSON object
I have read every single topic regarding this issue and could not find a solution, any thoughts?
{
"expo": {
"name": "*********",
"slug": "*********",
"privacy": "public",
"sdkVersion": "33.0.0",
"platforms": [
"ios",
"android"
],
"version": "1.0.91",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"updates": {
"*****************": 0
},
"assetBundlePatterns": ["assets/*"],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.*********.******",
"config": {
"usesNonExemptEncryption": false
}
},
"android": {
"package": "com.*********.**********",
"versionCode": 91,
"permissions": [
"NOTIFICATIONS",
"LOCATION",
"ACCESS_NETWORK_STATE",
"VIBRATE"
]
},
"description": "READY FOR TESTING"
}
}
In my case it was permission issue. Just try the admin mode of PowerShell or terminal.
I was having the same issue. Running with elevated privileges did not solve my issue. However, placing ios and android directly below the sdkVersion solved my issue. E.g.
{
"expo": {
"name": "*********",
"slug": "*********",
"privacy": "public",
"sdkVersion": "33.0.0",
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.*********.******",
"config": {
"usesNonExemptEncryption": false
}
},
"android": {
"package": "com.*********.**********",
"versionCode": 91,
"permissions": [
"NOTIFICATIONS",
"LOCATION",
"ACCESS_NETWORK_STATE",
"VIBRATE"
]
},
"platforms": [
"ios",
"android"
],
"version": "1.0.91",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"updates": {
"*****************": 0
},
"assetBundlePatterns": ["assets/*"],
"description": "READY FOR TESTING"
}
}

Alexa device discovery not working - can you see what's wrong with this json?

I can't get device discovery working. My discovery response is below. Alexa keeps saying that it can't find any new devices. Can you help?
This is data passed from my local server to the skill in lambda written in python then passed back to Alexa.
{
"event": {
"header": {
"messageId": "810212af-b373-4a23-a976-67c5d79324e4",
"name": "Discover.Response",
"namespace": "Alexa.Discovery",
"payloadVersion": "3"
},
"payload": {
"endpoints": [
{
"capabilities": [
{
"interface": "Alexa.ContactSensor",
"properties": {
"proactivelyReported": true,
"retrievable": false,
"supported": [
{
"name": "detectionState"
}
]
},
"type": "AlexaInterface",
"version": "3"
},
{
"interface": "Alexa.EndpointHealth",
"properties": {
"proactivelyReported": true,
"retrievable": false,
"supported": [
{
"name": "connectivity"
}
]
},
"type": "AlexaInterface",
"version": "3"
}
],
"displayCategories": [
"CONTACT_SENSOR"
],
"endpointID": "523F5AA2-079A-4A9A-94E2-EA4259357F80",
"friendlyName": "HumiditySensor",
"manufacturerName": "THCGuard AirNode",
"description": "AirNode output rule"
}
]
}
}
}
endpointID should be endpointId (lower case 'd')

Ionic Build Android command fails with an exception after trying to add ngCordova calendar plugin

I am working ionic(1.7.15) in ubuntu.
My project works fine until i try to implement calendar plugin. After installing this plugin to my project and i try to build with ionic build android command but i am getting the following error.
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
I hope the above error occurs due to multiple plugin in my project is there any solution. I found this error is related to multidex from here.
What i have tried:
I have tried the upgrading my android SDK.
Using this stack-overflow question Could not resolve all dependencies for configuration ':_armv7DebugCompile' i have done all after that i am getting the above error.
Here is my package.json file
{
"name": "app",
"version": "1.1.1",
"description": "app: An Ionic project",
"dependencies": {
"gulp": "^3.5.6",
"gulp-sass": "^2.0.4",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0"
},
"devDependencies": {
"bower": "^1.3.3",
"gulp-util": "^2.2.14",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard",
{
"locator": "https://github.com/rossmartin/PushPlugin.git",
"id": "com.phonegap.plugins.PushPlugin"
}
],
"cordovaPlatforms": [
"android"
]
}
Here is my fetch.json file
{
"cordova-plugin-device": {
"source": {
"type": "registry",
"id": "cordova-plugin-device#~1.1.1"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-console": {
"source": {
"type": "registry",
"id": "cordova-plugin-console#~1.0.2"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-whitelist": {
"source": {
"type": "registry",
"id": "cordova-plugin-whitelist"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-splashscreen": {
"source": {
"type": "registry",
"id": "cordova-plugin-splashscreen"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-statusbar": {
"source": {
"type": "registry",
"id": "cordova-plugin-statusbar#~2.1.0"
},
"is_top_level": true,
"variables": {}
},
"ionic-plugin-keyboard": {
"source": {
"type": "registry",
"id": "ionic-plugin-keyboard"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-camera": {
"source": {
"type": "registry",
"id": "cordova-plugin-camera"
},
"is_top_level": true,
"variables": {}
},
"phonegap-plugin-push": {
"source": {
"type": "registry",
"id": "phonegap-plugin-push"
},
"is_top_level": true,
"variables": {}
},
"com.phonegap.plugins.PushPlugin": {
"source": {
"type": "git",
"url": "https://github.com/phonegap-build/PushPlugin.git",
"subdir": "."
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-datepicker": {
"source": {
"type": "git",
"url": "https://github.com/VitaliiBlagodir/cordova-plugin-datepicker.git",
"subdir": "."
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-calendar": {
"source": {
"type": "registry",
"id": "cordova-plugin-calendar"
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-crosswalk-webview": {
"source": {
"type": "registry",
"id": "cordova-plugin-crosswalk-webview"
},
"is_top_level": true,
"variables": {}
}
}
I have no idea about what went wrong please anyone help me.
Your problem is you are using an outdated version of the push plugin. From your package.json, you are including https://github.com/rossmartin/PushPlugin.git which is a unmaintained branch of a deprecated plugin that hasn't been updated in 2 years. Hence, if you look at its plugin.xml, you can see it includes the Android Support Library as a JAR for the legacy Ant-driven Cordova build process:
<source-file src="src/android/com/plugin/android-support-v13.jar" target-dir="libs/" />
You need to remove this version of the plugin and replace it with the up-to-date equivalent cordova-plugin-push, which uses Gradle to include the support library:
<framework src="com.android.support:support-v13:23+" />
Note you will need to build for Android API v23, so must have this installed via the SDK Manager and be using v5+ of the Cordova Android platform (cordova-android#5+).
UPDATE
In build.gradle file i add this lines.
In dependencies add this line compile 'com.android.support:multidex:1.0.1'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
debugCompile project(path: "CordovaLib", configuration: "debug")
releaseCompile project(path: "CordovaLib", configuration: "release")
compile "com.android.support:support-v4:+"
// SUB-PROJECT DEPENDENCIES END
compile 'com.android.support:multidex:1.0.1'
}
default config add this line multiDexEnabled true
defaultConfig {
versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode") + "0")
applicationId privateHelpers.extractStringFromManifest("package")
if (cdvMinSdkVersion != null) {
minSdkVersion cdvMinSdkVersion
}
multiDexEnabled true
}
After adding this lines then i got his error reffer this website and i solved it by removing platform/android/libs/ You can see "android-support-v13.jar" delete that file
all your plugin that have been installed for project look for plugin.xml file and then check any line that reefer to that android-support-v13.jar and comment it or do as above, thank you
Here is an easy of-the-shelf plugin that does the build.gradle work for you
cordova plugin add cordova-plugin-enable-multidex
Please find this repository link for some further details

Sencha buil MVC3 file

I am unable to run sencha build command for my MVC application in ExtJs. but sencha create jsb command has successfully generated the file
{
"projectName": "Project Name",
"licenseText": "Copyright(c) 2011 Company Name",
"builds": [
{
"name": "All Classes",
"target": "all-classes.js",
"options": {
"debug": true
},
"files": []
},
{
"name": "Application - Production",
"target": "app-all.js",
"compress": true,
"files": [
{
"path": "",
"name": "all-classes.js"
},
{
"path": "",
"name": "app.js"
}
]
}
],
"resources": []
}
Can someone help me
Seems the jsb file it is not sucessfully created, the files of your application should be in "files" in the builds section but it isn't.
Like this:
...
"builds": [
{
"name": "All Classes",
"target": "all-classes.js",
"options": {
"debug": true
},
"files": [{
"path": "app/controller",
"name": "MyController.js"
}, {
... etc
}]
},
...
What version of the sdk are you using?

Resources