소스 검색

Don't crash if someone fills out the uninstall survey while offline

Antony Male 8 년 전
부모
커밋
afbd303742
1개의 변경된 파일17개의 추가작업 그리고 13개의 파일을 삭제
  1. 17 13
      installer/common.iss

+ 17 - 13
installer/common.iss

@@ -422,19 +422,23 @@ begin
     if UninstallProgressForm.ShowModal = mrCancel then Abort;
 
     if Checklist.Checked[0] or Checklist.Checked[1] or Checklist.Checked[2] or Checklist.Checked[3] or Checklist.Checked[4] or (CommentsBox.Text <> '') then begin
-      WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
-      WinHttpReq.Open('POST', '{#SurveyUrl}', false);
-      WinHttpReq.Send('{' +
-        ' "version": "{#AppVersion}"' +
-        ', "comment": "' + EscapeJsonString(CommentsBox.Text) + '"' +
-        ', "checklist": {' +
-          ' "wontWork": '+ SerializeBool(Checklist.Checked[0]) + 
-          ', "notWhatINeed": '+ SerializeBool(Checklist.Checked[1]) +
-          ', "preferAnotherSyncTool": '+ SerializeBool(Checklist.Checked[2]) +
-          ', "dontLikeSyncTrayzor": '+ SerializeBool(Checklist.Checked[3]) +
-          ', "other": '+ SerializeBool(Checklist.Checked[4]) +
-        ' }' +
-        ' }');
+      try
+      begin
+        WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
+        WinHttpReq.Open('POST', '{#SurveyUrl}', false);
+        WinHttpReq.Send('{' +
+          ' "version": "{#AppVersion}"' +
+          ', "comment": "' + EscapeJsonString(CommentsBox.Text) + '"' +
+          ', "checklist": {' +
+            ' "wontWork": '+ SerializeBool(Checklist.Checked[0]) + 
+            ', "notWhatINeed": '+ SerializeBool(Checklist.Checked[1]) +
+            ', "preferAnotherSyncTool": '+ SerializeBool(Checklist.Checked[2]) +
+            ', "dontLikeSyncTrayzor": '+ SerializeBool(Checklist.Checked[3]) +
+            ', "other": '+ SerializeBool(Checklist.Checked[4]) +
+          ' }' +
+          ' }');
+      end except
+      end;
     end;
 
     // Restore the standard page payout