diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js index 9117a021b5a9c..0d3abdae01b9e 100644 --- a/build/gulpfile.vscode.win32.js +++ b/build/gulpfile.vscode.win32.js @@ -87,7 +87,7 @@ function buildWin32Setup(arch, target) { productJson['target'] = target; fs.writeFileSync(productJsonPath, JSON.stringify(productJson, undefined, '\t')); - const quality = product.quality; + const quality = product.quality || 'dev'; const definitions = { NameLong: product.nameLong, NameShort: product.nameShort, @@ -115,11 +115,7 @@ function buildWin32Setup(arch, target) { }; if (quality === 'insider') { - const appxPackagePrefix = 'code_insiders'; - definitions['AppxPackage'] = `${appxPackagePrefix}_explorer_${arch}.appx`; - if (arch === 'ia32') { - definitions['AppxPackage'] = `${appxPackagePrefix}_explorer_x86.appx`; - } + definitions['AppxPackage'] = `code_insiders_explorer_${arch === 'ia32' ? 'x86' : arch}.appx`; definitions['AppxPackageFullname'] = `Microsoft.${product.win32RegValueName}_1.0.0.0_neutral__8wekyb3d8bbwe`; } diff --git a/build/win32/code.iss b/build/win32/code.iss index 9376add416f9f..d365ab1cbdaaa 100644 --- a/build/win32/code.iss +++ b/build/win32/code.iss @@ -88,8 +88,10 @@ Name: "{app}"; AfterInstall: DisableAppDirInheritance [Files] Source: "*"; Excludes: "\CodeSignSummary*.md,\tools,\tools\*,\appx,\appx\*,\resources\app\product.json"; DestDir: "{code:GetDestDir}"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "tools\*"; DestDir: "{app}\tools"; Flags: ignoreversion -Source: "appx\*"; DestDir: "{app}\appx"; BeforeInstall: RemoveAppxPackage; AfterInstall: AddAppxPackage; Flags: ignoreversion; Check: IsWindows11OrLater and QualityIsInsiders Source: "{#ProductJsonPath}"; DestDir: "{code:GetDestDir}\resources\app"; Flags: ignoreversion +#ifdef AppxPackageFullname +Source: "appx\*"; DestDir: "{app}\appx"; BeforeInstall: RemoveAppxPackage; AfterInstall: AddAppxPackage; Flags: ignoreversion; Check: IsWindows11OrLater and QualityIsInsiders +#endif [Icons] Name: "{group}\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; AppUserModelID: "{#AppUserId}" @@ -100,8 +102,10 @@ Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#NameLong}"; File Filename: "{app}\{#ExeBasename}.exe"; Description: "{cm:LaunchProgram,{#NameLong}}"; Tasks: runcode; Flags: nowait postinstall; Check: ShouldRunAfterUpdate Filename: "{app}\{#ExeBasename}.exe"; Description: "{cm:LaunchProgram,{#NameLong}}"; Flags: nowait postinstall; Check: WizardNotSilent +#ifdef AppxPackageFullname [UninstallRun] Filename: "powershell.exe"; Parameters: "Invoke-Command -ScriptBlock {{Remove-AppxPackage -Package ""{#AppxPackageFullname}""}"; Check: IsWindows11OrLater and QualityIsInsiders; Flags: shellexec waituntilterminated runhidden +#endif [Registry] #if "user" == InstallTarget @@ -1418,6 +1422,7 @@ begin Result := False; end; +#ifdef AppxPackageFullname procedure AddAppxPackage(); var AddAppxPackageResultCode: Integer; @@ -1440,6 +1445,7 @@ begin RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\{#RegValueName}ContextMenu'); end; end; +#endif procedure CurStepChanged(CurStep: TSetupStep); var