update-msi.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. diff --git a/src/vs/platform/update/common/update.ts b/src/vs/platform/update/common/update.ts
  2. index 7cd4a84..7cbdf21 100644
  3. --- a/src/vs/platform/update/common/update.ts
  4. +++ b/src/vs/platform/update/common/update.ts
  5. @@ -48,3 +48,4 @@ export const enum UpdateType {
  6. Archive,
  7. - Snap
  8. + Snap,
  9. + WindowsInstaller,
  10. }
  11. diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts
  12. index caecd71..eb85ed0 100644
  13. --- a/src/vs/platform/update/electron-main/updateService.win32.ts
  14. +++ b/src/vs/platform/update/electron-main/updateService.win32.ts
  15. @@ -41,5 +41,9 @@ function getUpdateType(): UpdateType {
  16. if (typeof _updateType === 'undefined') {
  17. - _updateType = fs.existsSync(path.join(path.dirname(process.execPath), 'unins000.exe'))
  18. - ? UpdateType.Setup
  19. - : UpdateType.Archive;
  20. + if (fs.existsSync(path.join(path.dirname(process.execPath), 'unins000.exe'))) {
  21. + _updateType = UpdateType.Setup;
  22. + } else if (path.basename(path.normalize(path.join(process.execPath, '..', ''))) === 'Program Files') {
  23. + _updateType = UpdateType.WindowsInstaller;
  24. + } else {
  25. + _updateType = UpdateType.Archive;
  26. + }
  27. }
  28. @@ -89,6 +93,13 @@ export class Win32UpdateService extends AbstractUpdateService {
  29. - if (getUpdateType() === UpdateType.Archive) {
  30. - platform += '-archive';
  31. - } else if (this.productService.target === 'user') {
  32. - platform += '-user';
  33. + switch (getUpdateType()) {
  34. + case UpdateType.Archive:
  35. + platform += '-archive';
  36. + break;
  37. + case UpdateType.WindowsInstaller:
  38. + platform += '-msi';
  39. + break;
  40. + default:
  41. + if (this.productService.target === 'user') {
  42. + platform += '-user';
  43. + }
  44. }