Skip to content

Commit

Permalink
AutoUpdate Feature Health Data Logging Changes (adobe#639)
Browse files Browse the repository at this point in the history
* AutoUpdate Feature Health Data Logging Changes

* AutoUpdate Health Data Logging Changes

* Corrected the Unintenional Change
  • Loading branch information
niteskum authored and nethip committed Apr 23, 2018
1 parent cb6ab77 commit d5c923f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions appshell/update_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ + (void) RunAppUpdate{
if (filePresent) {
NSString *logStr;
if([hdiPath length] == 0 ) {
logStr = @"hdiutil command could not be found";
logStr = @"ERROR: hdiutil command could not be found: BA_01";
[logStr writeToFile:installStatusFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil];
}
if([shPath length] == 0 ) {
logStr = @"sh command could not be found";
logStr = @"ERROR: sh command could not be found: BA_02";
[logStr writeToFile:installStatusFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil];
}
if([nohupPath length] == 0 ) {
logStr = @"nohupPath command could not be found";
logStr = @"ERROR: nohupPath command could not be found: BA_03";
[logStr writeToFile:installStatusFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil];
}
}
Expand Down Expand Up @@ -165,7 +165,7 @@ + (void) RunAppUpdate{
if (![[NSFileManager defaultManager] fileExistsAtPath:scriptPath]) {
BOOL filePresent = [self createFileItNotExists:installStatusFilePath];
if (filePresent) {
NSString *logStr = @"update script could not be found";
NSString *logStr = @"ERROR: update script could not be found: BA_04";
[logStr writeToFile:installStatusFilePath atomically:YES encoding:NSUTF8StringEncoding error:nil];
}
}
Expand Down
6 changes: 3 additions & 3 deletions appshell/update_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void UpdateHelper::RunAppUpdate() {
fp = _wfopen(m_installStatusFilePath.c_str(), L"a+");
if (fp != NULL) {
std::wstring errStr = std::to_wstring(err);
fwprintf(fp, L"Installer process could not be created successfully. Error : %s \n", errStr.c_str());
fwprintf(fp, L"Installer process could not be created successfully. ERROR: %s : BA_05\n", errStr.c_str());
}
}
}
Expand All @@ -98,15 +98,15 @@ void UpdateHelper::RunAppUpdate() {
//Command line interpreter could not be fetched
if (fp != NULL) {
std::wstring comspecStr = std::to_wstring(comspecEnv);
fwprintf(fp, L"Command line interpreter could not be fetched from the current environment. Error : %s \n", comspecStr.c_str());
fwprintf(fp, L"Command line interpreter could not be fetched from the current environment. ERROR: %s : BA_06\n", comspecStr.c_str());
}
}
else
{
//COMSPEC variable not found
if (fp != NULL) {
std::wstring nSizeStr = std::to_wstring(nSize);
fwprintf(fp, L"COMSPEC not found in the current environment. Error : %s \n", nSizeStr.c_str());
fwprintf(fp, L"COMSPEC not found in the current environment. ERROR: %s : BA_07\n", nSizeStr.c_str());
}
}
}
Expand Down
28 changes: 14 additions & 14 deletions installer/mac/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,37 @@ function printError(){
function verifySetup(){
if [ "$APP_DIR" == "$EMPTY_STRING" ]
then
printError "Brackets app dir is missing"
printError "Brackets app dir is missing: INS_O1"
return $OPTIONS_MISSING
fi

if [ "$APP_NAME" == "$EMPTY_STRING" ]
then
printError "Brackets app is missing"
printError "Brackets app is missing: INS_02"
return $OPTIONS_MISSING
fi

if [ "$LOG_FILE" == "$EMPTY_STRING" ]
then
printError "Installer log file is missing"
printError "Installer log file is missing: INS_03"
return $OPTIONS_MISSING
fi

if [ "$MOUNT_POINT" == "$EMPTY_STRING" ]
then
printError "DMG mount point is missing"
printError "DMG mount point is missing: INS_04"
return $OPTIONS_MISSING
fi

if [ "$TEMP_DIR" == "$EMPTY_STRING" ]
then
printError "Temp directory is missing"
printError "Temp directory is missing: INS_05"
return $OPTIONS_MISSING
fi

if [ "$PID" == "$EMPTY_STRING" ]
then
printError "PID of current Brackets is missing"
printError "PID of current Brackets is missing: INS_06"
return $OPTIONS_MISSING
fi

Expand Down Expand Up @@ -100,7 +100,7 @@ function updateBrackets(){
exitStatus=$?
if [ $exitStatus -ne 0 ]
then
printError "Unable to move the existing Brackets app to temp directory updateTemp. mv retured $exitStatus"
printError "Unable to move the existing Brackets app to temp directory updateTemp. mv retured $exitStatus : INS_07"
abortInstallation=1
else
printInfo "Move Successful"
Expand All @@ -116,7 +116,7 @@ function updateBrackets(){
exitStatus=$?
if [ $exitStatus -ne 0 ]
then
printError "Unable to copy Brackets.app. cp retured $exitStatus"
printError "Unable to copy Brackets.app. cp retured $exitStatus : INS_08"
abortInstallation=1
else
printInfo "Brackets.app is copied."
Expand All @@ -127,22 +127,22 @@ function updateBrackets(){

if [ $exitStatus -ne 0 ]
then
printError "Unable to verify the downloaded $APP_DIR/$APP_NAME. codesign retured $exitStatus"
printError "Unable to verify the downloaded $APP_DIR/$APP_NAME. codesign retured $exitStatus : INS_09"
abortInstallation=1

printInfo "Deleting the new app copied."
rm -f $APP_DIR/$APP_NAME
exitStatus=$?
if [ $exitStatus -ne 0 ]
then
printError "Unable to delete $APP_DIR/$APP_NAME. rm retured $exitStatus"
printError "Unable to delete $APP_DIR/$APP_NAME. rm retured $exitStatus : INS_10"
else
printInfo "Moving the old brackets back from AppData"
mv "$TEMP_DIR/$APP_NAME" "$APP_DIR/$APP_NAME"
exitStatus=$?
if [ $exitStatus -ne 0 ]
then
printError "Unable to move the old brackets back from AppData. mv retured $exitStatus"
printError "Unable to move the old brackets back from AppData. mv retured $exitStatus : INS_11"
fi
fi
else
Expand Down Expand Up @@ -176,13 +176,13 @@ function updateBrackets(){
exitStatus=$?
if [ $exitStatus -ne 0 ]
then
printError "Brackets could not be opened. open returnd $exitStatus."
printError "Brackets could not be opened. open returnd $exitStatus : INS_12"
else
printInfo "Opened Brackets."
fi

else
printError "Brackets could not be exited properly. lsof returned $exitStatus"
printError "Brackets could not be exited properly. lsof returned $exitStatus : INS_13"
fi

}
Expand Down Expand Up @@ -247,7 +247,7 @@ verifySetup
result=$?
if [ $result -ne $SUCCESS ]
then
printError "Invalid setup"
printError "Invalid setup : INS_14"
exit $result
fi

Expand Down

0 comments on commit d5c923f

Please sign in to comment.