Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23800] CLI hangs on install of app when a different app installed #54

Merged
merged 1 commit into from
Aug 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.4.19 (8/23/2016)
-------------------
* [TIMOB-23800] CLI hangs on install of app when a different app is installed

0.4.18 (8/12/2016)
-------------------
* [TIMOB-23762] Handle duplicate package error from Windows SDK 10.0.14393
Expand Down
9 changes: 7 additions & 2 deletions lib/wptool.js
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,13 @@ function wpToolInstall(deployCmd, device, appPath, options, callback) {
if (code) {
// handle duplicate package identity error code from Windows 10.0.14393 tooling and above
if (code == '2148734208') {
options.forceUnInstall = true;
wpToolInstall(deployCmd, device, appPath, options, callback);
if (out.indexOf('because the current user does not have that package installed') == -1) {
options.forceUnInstall = true;
wpToolInstall(deployCmd, device, appPath, options, callback);
} else {
// Windows cannot remove the app because the current user does not have that package installed.
callback(new Error('A debug application is already installed, please remove existing debug application'));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: How this works:

  1. When different app is installed with same product id, the command fails to install new one
  2. It returns the code 2148734208, and then we try to uninstall it (wpToolInstall)
  3. Then the command fails to uninstall because it has different package name
  4. It returns the code 2148734208 again with message current user does not have that package installed
  5. Then we end up displaying error message

} else {
var errmsg = out.trim().split(/\r\n|\n/).shift(),
ex = new Error(/^Error: /.test(errmsg) ? errmsg.substring(7) : __('Failed to install app (code %s): %s', code, out));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "windowslib",
"version": "0.4.18",
"version": "0.4.19",
"description": "Windows Phone Utility Library",
"keywords": [
"appcelerator",
Expand Down