@@ -34,7 +34,6 @@ ShowLanguageDialog=auto
3434ArchitecturesAllowed = {#ArchitecturesAllowed}
3535ArchitecturesInstallIn64BitMode = {#ArchitecturesInstallIn64BitMode}
3636WizardStyle = modern
37- SetupLogging = yes
3837
3938#ifdef Sign
4039SignTool = esrp
@@ -89,7 +88,7 @@ Name: "{app}"; AfterInstall: DisableAppDirInheritance
8988[Files]
9089Source : " *" ; Excludes: " \CodeSignSummary*.md,\tools,\tools\*,\appx,\appx\*,\resources\app\product.json" ; DestDir : " {code:GetDestDir}" ; Flags : ignoreversion recursesubdirs createallsubdirs
9190Source : " tools\*" ; DestDir : " {app} \tools" ; Flags : ignoreversion
92- Source : " appx\*" ; DestDir : " {app} \appx" ; BeforeInstall : RemoveAppxPackage; AfterInstall : AddAppxPackage; Flags : ignoreversion
91+ Source : " appx\*" ; DestDir : " {app} \appx" ; BeforeInstall : RemoveAppxPackage; AfterInstall : AddAppxPackage; Flags : ignoreversion ; Check : IsWindows11OrLater and QualityIsInsiders
9392Source : " {#ProductJsonPath}" ; DestDir : " {code:GetDestDir}\resources\app" ; Flags : ignoreversion
9493
9594[Icons]
@@ -1423,26 +1422,22 @@ procedure AddAppxPackage();
14231422var
14241423 AddAppxPackageResultCode: Integer;
14251424begin
1426- if IsWindows11OrLater() and QualityIsInsiders() then begin
1427- if WizardIsTaskSelected(' addcontextmenufiles' ) then begin
1428- ShellExec(' ' , ' powershell.exe' , ' -Command ' + AddQuotes(' Add-AppxPackage -Path '' ' + ExpandConstant(' {app}\appx\{#AppxPackage}' ) + ' '' -ExternalLocation '' ' + ExpandConstant(' {app}\appx' ) + ' '' ' ), ' ' , SW_HIDE, ewWaitUntilTerminated, AddAppxPackageResultCode);
1429- RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\*\shell\{#RegValueName}' );
1430- RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\directory\shell\{#RegValueName}' );
1431- RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\directory\background\shell\{#RegValueName}' );
1432- RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\Drive\shell\{#RegValueName}' );
1433- end ;
1425+ if WizardIsTaskSelected(' addcontextmenufiles' ) then begin
1426+ ShellExec(' ' , ' powershell.exe' , ' -Command ' + AddQuotes(' Add-AppxPackage -Path '' ' + ExpandConstant(' {app}\appx\{#AppxPackage}' ) + ' '' -ExternalLocation '' ' + ExpandConstant(' {app}\appx' ) + ' '' ' ), ' ' , SW_HIDE, ewWaitUntilTerminated, AddAppxPackageResultCode);
1427+ RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\*\shell\{#RegValueName}' );
1428+ RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\directory\shell\{#RegValueName}' );
1429+ RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\directory\background\shell\{#RegValueName}' );
1430+ RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\Drive\shell\{#RegValueName}' );
14341431 end ;
14351432end ;
14361433
14371434procedure RemoveAppxPackage ();
14381435var
14391436 RemoveAppxPackageResultCode: Integer;
14401437begin
1441- if IsWindows11OrLater() and QualityIsInsiders() then begin
1442- ShellExec(' ' , ' powershell.exe' , ' -Command ' + AddQuotes(' Remove-AppxPackage -Package '' {#AppxPackageFullname}'' ' ), ' ' , SW_HIDE, ewWaitUntilTerminated, RemoveAppxPackageResultCode);
1443- if not WizardIsTaskSelected(' addcontextmenufiles' ) then begin
1444- RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\{#RegValueName}ContextMenu' );
1445- end ;
1438+ ShellExec(' ' , ' powershell.exe' , ' -Command ' + AddQuotes(' Remove-AppxPackage -Package '' {#AppxPackageFullname}'' ' ), ' ' , SW_HIDE, ewWaitUntilTerminated, RemoveAppxPackageResultCode);
1439+ if not WizardIsTaskSelected(' addcontextmenufiles' ) then begin
1440+ RegDeleteKeyIncludingSubkeys({ #EnvironmentRootKey} , ' Software\Classes\{#RegValueName}ContextMenu' );
14461441 end ;
14471442end ;
14481443
0 commit comments