You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/08/05 10:17:29 UTC

[GitHub] [cordova-electron] zdm opened a new issue #163: app.getVersion() is invalid

zdm opened a new issue #163:
URL: https://github.com/apache/cordova-electron/issues/163


   # Bug Report
   
   ## Problem
   app. getVersion() returns electron package version instead of version from app package.json.
   
   ### What is expected to happen?
   Expected to get version string from app package.json.
   
   
   ### What does actually happen?
   Actually I get version from electron package.json.
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   ```
   const app = electron.app || electron.remote.app;
   console.log(app.getVersion());
   ```
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   
   Windows 10
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [ x] I searched for existing GitHub issues
   - [ x] I updated all Cordova tooling to most recent version
   - [ x] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-electron] zdm closed issue #163: app.getVersion() is invalid

Posted by GitBox <gi...@apache.org>.
zdm closed issue #163:
URL: https://github.com/apache/cordova-electron/issues/163


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-electron] zdm commented on issue #163: app.getVersion() is invalid

Posted by GitBox <gi...@apache.org>.
zdm commented on issue #163:
URL: https://github.com/apache/cordova-electron/issues/163#issuecomment-669730009


   It works incorrectly when running with `cordova run` command, no matter with `--no build` option or without.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-electron] ComexioDev commented on issue #163: app.getVersion() is invalid

Posted by GitBox <gi...@apache.org>.
ComexioDev commented on issue #163:
URL: https://github.com/apache/cordova-electron/issues/163#issuecomment-669729929


   I dont know how to achieve this. I can only tell you, that it works in a release build.
   
   Maybe you could do something hacky like:
   
   `const appVersion = <yourAppVersion>;
   const electronVersion = <yourElectronVersion>;
   let version = app. getVersion();
   if(version === electronVersion){version = appVersion;}`
   Then use `version` in your Code instead of ` app. getVersion()`
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-electron] zdm commented on issue #163: app.getVersion() is invalid

Posted by GitBox <gi...@apache.org>.
zdm commented on issue #163:
URL: https://github.com/apache/cordova-electron/issues/163#issuecomment-669723812


   I need to get correct version when run with --nobuild.
   I don;t need to build it every time, this is long.
   Do you know, how to achieve this?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-electron] zdm commented on issue #163: app.getVersion() is invalid

Posted by GitBox <gi...@apache.org>.
zdm commented on issue #163:
URL: https://github.com/apache/cordova-electron/issues/163#issuecomment-669949862


   ```
           var version;
   
           // devel mode
           if ( app.getName() === "Electron" ) {
               version = window.require( "../../../package.json" ).version;
           }
   
           // production mode
           else {
               version = app.getVersion();
           }
   ```
   I will close this issue, because it is not directly related to the cordova-electron.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-electron] ComexioDev commented on issue #163: app.getVersion() is invalid

Posted by GitBox <gi...@apache.org>.
ComexioDev commented on issue #163:
URL: https://github.com/apache/cordova-electron/issues/163#issuecomment-669721307


   I have the same problem, but only if i am running my app with "cordova run electron --nobuild".
   Try building the app, run the app itself (platform/electron/build/yourplatform-unpacked/yourapp) and test it again.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org