Skip to content

Commit

Permalink
Release port: fix inno setup build for non-insider qualities (#165152)
Browse files Browse the repository at this point in the history
fix inno setup build for non-insider qualities

fixes #165142
  • Loading branch information
joaomoreno authored Nov 1, 2022
1 parent 7144ff7 commit 8fa188b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 2 additions & 6 deletions build/gulpfile.vscode.win32.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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`;
}

Expand Down
8 changes: 7 additions & 1 deletion build/win32/code.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
Expand Down Expand Up @@ -1418,6 +1422,7 @@ begin
Result := False;
end;
#ifdef AppxPackageFullname
procedure AddAppxPackage();
var
AddAppxPackageResultCode: Integer;
Expand All @@ -1440,6 +1445,7 @@ begin
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\{#RegValueName}ContextMenu');
end;
end;
#endif
procedure CurStepChanged(CurStep: TSetupStep);
var
Expand Down

0 comments on commit 8fa188b

Please sign in to comment.