@@ -514,18 +514,19 @@ end;
514
514
515
515
// /<remarks>
516
516
// /Called after successfully installing, including via the elevated installer
517
- // /to register the VBE addin. Should be never run under elevated context
518
- // /or the registration may not work as expected.
517
+ // /to register the VBE addin.
519
518
// /</remarks>
520
519
procedure RegisterAddin ();
521
520
begin
522
- if not IsElevated() then
523
- begin
524
- RegisterAddinForIDE(HKCU32, ' Software\Microsoft\VBA\VBE\6.0\Addins' , ' {#AddinProgId}' );
525
-
526
521
if IsWin64() then
522
+ begin
523
+ RegisterAddinForIDE(HKCU32, ' Software\Microsoft\VBA\VBE\6.0\Addins' , ' {#AddinProgId}' );
527
524
RegisterAddinForIDE(HKCU64, ' Software\Microsoft\VBA\VBE\6.0\Addins64' , ' {#AddinProgId}' );
528
- end ;
525
+ end
526
+ else
527
+ begin
528
+ RegisterAddinForIDE(HKCU, ' Software\Microsoft\VBA\VBE\6.0\Addins' , ' {#AddinProgId}' );
529
+ end ;
529
530
end ;
530
531
531
532
// /<remarks>
@@ -816,11 +817,10 @@ begin
816
817
ExpandConstant(' {cm:RegisterAddInCaption}' ),
817
818
ExpandConstant(' {cm:RegisterAddInMessage}' ),
818
819
ExpandConstant(' {cm:RegisterAddInDescription}' ),
819
- False, False );
820
+ false, false );
820
821
821
822
RegisterAddInOptionPage.Add(ExpandConstant(' {cm:RegisterAddInButtonCaption}' ));
822
- RegisterAddInOptionPage.CheckListBox.ItemEnabled[0 ] := not IsElevated();
823
- RegisterAddInOptionPage.Values[0 ] := not IsElevated();
823
+ RegisterAddInOptionPage.Values[0 ] := true;
824
824
end ;
825
825
826
826
// /<remarks>
@@ -847,14 +847,6 @@ begin
847
847
PagesSkipped := True;
848
848
end ;
849
849
850
- // If the installer is elevated, we cannot register the addin so we must skip the
851
- // custom page.
852
- if (PageID = RegisterAddInOptionPage.ID) and IsElevated() then
853
- begin
854
- Log(' RegisterAddInOptionPage skipped because we are running elevated.' );
855
- Result := true;
856
- end ;
857
-
858
850
// We don't need to show the users finished panel from the elevated installer
859
851
// if they already have the non-elevated installer running.
860
852
if (PageID = wpFinished) and HasElevateSwitch then
@@ -998,14 +990,14 @@ begin
998
990
// custom page we should run RegisterAdd()
999
991
else if CurPageID = RegisterAddInOptionPage.ID then
1000
992
begin
1001
- if not IsElevated() and RegisterAddInOptionPage.Values[0 ] then
993
+ if RegisterAddInOptionPage.Values[0 ] then
1002
994
begin
1003
995
Log(' Addin registration was requested and will be performed' );
1004
996
RegisterAddIn();
1005
997
end
1006
998
else
1007
999
begin
1008
- Log(' Addin registration was declined because either we are elevated or the user unchecked the checkbox' );
1000
+ Log(' Addin registration was declined because the user unchecked the checkbox' );
1009
1001
end ;
1010
1002
end ;
1011
1003
0 commit comments