Skip to content

Commit

Permalink
[TIMOB-25616] Don't forceUnInstall unless user explicitly specifies it (
Browse files Browse the repository at this point in the history
#83)

* [TIMOB-25616] Implement forceUnInstall option
  • Loading branch information
infosia committed Jan 22, 2018
1 parent 59fd594 commit db69099
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.6.4 (19/12/2017)
* [TIMOB-25616] Don't forceUnInstall unless user explicitly specifies it
0.6.3 (27/11/2017)
* [DAEMON-184] Remove unnecessary quote when building project
0.6.2 (27/11/2017)
Expand Down
16 changes: 11 additions & 5 deletions lib/wptool.js
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,11 @@ function wpToolInstall(deployCmd, device, appPath, options, callback) {
// handle duplicate package identity error code from Windows 10.0.14393 tooling and above
if (code == '2148734208') {
if (out.indexOf('because the current user does not have that package installed') == -1) {
options.forceUnInstall = true;
wpToolInstall(deployCmd, device, appPath, options, callback);
if (options.forceUnInstall) {
wpToolInstall(deployCmd, device, appPath, options, callback);
} else {
callback(new Error('A debug application is already installed. Please increment the version number of the application, or use forceUnInstall option to explicitly delete existing app.'));
}
} 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'));
Expand All @@ -924,9 +927,12 @@ function wpToolInstall(deployCmd, device, appPath, options, callback) {
if (err == '0x80073CF9') {
callback(new Error('A debug application is already installed, please remove existing debug application'));
} else if (err == '0x80073CFB') {
// Provided package has the same identity as an already-installed package. Proceed uninstalling.
options.forceUnInstall = true;
wpToolInstall(deployCmd, device, appPath, options, callback);
if (options.forceUnInstall) {
// Provided package has the same identity as an already-installed package. Proceed uninstalling.
wpToolInstall(deployCmd, device, appPath, options, callback);
} else {
callback(new Error('A debug application is already installed. Please increment the version number of the application, or use forceUnInstall option to explicitly delete existing app.'));
}
} else {
callback(new Error(__('Failed to install app (code %s): %s', err, msg)));
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.6.3",
"version": "0.6.4",
"description": "Windows Phone Utility Library",
"keywords": [
"appcelerator",
Expand Down

0 comments on commit db69099

Please sign in to comment.