|
|
|
#1
|
||||
|
||||
|
Dear Blackfire69. Could you clarify about FUserInfo. As you wrote in the examples, this is not quite suitable, at least for Windows 11. Unknown is displayed in it. If this function defines only the administrator from under the built-in account, and the user from the user group, then this is not entirely correct, probably. I tried to determine by type sid like this
Code:
var
UserSidType: Integer;
s1 : String;
...............................
s1 := Copy(UserInfo.SID,42,3)+Copy(UserInfo.SID,45,1);
UserSidType := StrToInt(s1);
if UserSidType > 1000 then
UserSidType := 1001 ;
// SUserType
case UserSidType of
500: UserTypeStr := 'Administrator';
1001: UserTypeStr := 'Standard User';
else
UserTypeStr := 'Unknown';
end;
And if the user, administrator rights? Whereas? Could you clarify this issue. Last edited by crachlow; 27-08-2023 at 08:55. |
| The Following User Says Thank You to crachlow For This Useful Post: | ||
audiofeel (27-08-2023) | ||
| Sponsored Links |
|
#2
|
||||
|
||||
|
Quote:
case IsAdminLoggedOn of 0: UserTypeStr := 'Group Users'; 1: UserTypeStr := 'Group Administrators'; and GetUserNameString; from innosetup works more correctly. In Russian localization UserInfo.UserType, and maybe in others, does not work at all, it is also difficult to determine by sid, because sid will be different in different localizations. |
|
#3
|
||||
|
||||
|
Quote:
Code:
{Setup]
...
PrivilegesRequired=admin ---> 'Admin' (IsAdminLoggedOn is True)
PrivilegesRequired=lowest ---> 'Standard' (IsAdminLoggedOn is False)
|
|
#4
|
||||
|
||||
|
Quote:
https://i.ibb.co/qkTghLR/2023-08-30-124000.png https://i.ibb.co/bbzydjt/2023-08-30-124232.png https://i.ibb.co/Sv5fvDg/2023-08-30-124405.png PrivilegesRequired=admin ---> 'Admin' (IsAdminLoggedOn is True) PrivilegesRequired=lowest ---> 'Standard' (IsAdminLoggedOn is False) it's not the same Last edited by crachlow; 30-08-2023 at 05:09. |
|
#5
|
||||
|
||||
|
FMXInno - Updates : [2023-August-31]
Code:
* Added TImageList. * Added TSpeedButton. * Added TCornorButton. * Added TMultiView. * Added TShadowTextClassic. * Added new functions. * Added new properties. * Included the fix for the 'white-square' issue during loading. - Don't forget to call the 'FMXForm.Show' after the 'FMXDesigning' procedure. * Fixed DrawFrame. * Some improvements and bug fixes. Quote:
now we've the 'TShadowTextClassic' class, which allows users to change the position(X, Y) of the shadow. Code:
procedure Shadow(FColor: TAlphaColor; OffsetX, OffsetY: Single); Quote:
i've added three new functions to help accomplish this. Code:
function wGetSysDefaultIcons(const Src: WideString; SHLIcoSize: Cardinal; const Buffer: PAnsiChar; var Count: Cardinal): Integer; function wGetSysDefaultIcons2(const Src, OutImgFile: WideString; SHLIcoSize: Cardinal): Boolean; function wGetSysDefaultIconsSize(const Src: WideString; SHLIcoSize: Cardinal): Integer; Code:
const SHL_ICO_SZ_LARGE = $0000; // 32x32 pixels. SHL_ICO_SZ_SMALL = $0001; // 16x16 pixels. SHL_ICO_SZ_EXTRALARGE = $0002; // 48x48 pixels. SHL_ICO_SZ_SYSSMALL = $0003; // SM_CXSMICON x SM_CYSMICON pixels. SHL_ICO_SZ_JUMBO = $0004; // 256x256 pixels. (Windows Vista and later.) you'll find an example for this in the attachment at the moment, if i extract icons from a windows ResDll using an index, then those icon files will only be '32x32' in maximum size. so let's use above functions. Example: Code:
{ GetSysDefaultIcons }
if wGetLogicalDriveList(ADrvLst, CDrvIdx) then
begin
ASrc[1] := ADrvLst[CDrvIdx];
ASrc[2] := ADrvLst[Length(ADrvLst) -1];
end else
begin
ASrc[1] := 'C:\';
if wIsDriveValid('D:\') then ASrc[2] := 'D:\'
else if wIsDriveValid('E:\') then ASrc[2] := 'E:\'
else if wIsDriveValid('F:\') then ASrc[2] := 'F:\'
else if wIsDriveValid('G:\') then ASrc[2] := 'G:\'
end;
ASrc[3] := 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe';
ASrc[4] := 'C:\Users\' + AddBackslash(GetUserNameString) + 'Desktop';
ASrc[5] := 'C:\Users\' + AddBackslash(GetUserNameString) + 'Downloads';
ASrc[6] := 'C:\Users\' + AddBackslash(GetUserNameString) + 'Documents';
P := 0; Q := 0;
Code:
for i := 1 to C_RANGE do
begin
if i = (C_RANGE div 2) + 1 {i =4} then
begin
P := 0; Q := 160;
end;
AImage[i].FCreate(FMXForm.Handle);
AImage[i].SetBounds(NSX(P + 80), NSY(Q + 80), NSX(100), NSY(100));
#ifdef AMethod1 /* Extract SysDefaultIcons into a Buffer, then load them into AImage[i] */
ImgSize[i] := wGetSysDefaultIconsSize(ASrc[i], SHL_ICO_SZ_JUMBO);
if ImgSize[i] <> -1 then
begin
SetLength(Buffer[i], ImgSize[i]);
if wGetSysDefaultIcons(ASrc[i], SHL_ICO_SZ_JUMBO, Buffer[i], Count[i]) <> -1 then
AImage[i].LoadPictureFromBuffer(Buffer[i], Count[i], wmTileStretch);
end;
#else /* Extract SysDefaultIcons into the TmpDir, then load them into AImage[i] */
ImgFile[i] := ExpandConstant('{tmp}\') + IntToStr(i) + '.png';
if wGetSysDefaultIcons2(ASrc[i], ImgFile[i], SHL_ICO_SZ_JUMBO) then
begin
AImage[i].LoadPicture(ImgFile[i], wmTileStretch);
end;
#endif
P := P + 150;
end;
{ GetSysDefaultIcons }
'LoadImgFromBuffer' is only supported by the 'FImage' control. Other controls will get this support in future updates. ------------------------------------------------------------------------------------------------------------------------------ Quote:
The first post has been updated. . Last edited by BLACKFIRE69; 14-07-2024 at 02:03. |
| The Following 4 Users Say Thank You to BLACKFIRE69 For This Useful Post: | ||
|
#6
|
||||
|
||||
|
HotFix: 01
- Fixed for Windows 10 Users. . Last edited by BLACKFIRE69; 02-09-2023 at 09:09. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM | BLACKFIRE69 | Conversion Tutorials | 0 | 15-11-2023 17:35 |
| Windows Phone Installer similar to razor12911's original design? | Kitsune1982 | Conversion Tutorials | 0 | 02-07-2020 13:04 |
| INDEX - Conversion Tutorial Index | Razor12911 | Conversion Tutorials | 5 | 11-06-2020 02:05 |
| Frequently Asked Questions | Joe Forster/STA | PC Games - Frequently Asked Questions | 0 | 29-11-2005 09:48 |