|
|
|
#1
|
||||
|
||||
|
Quote:
sorry for the delayed response; i've been quite busy these past few days and, to be honest, i haven't had a good night's sleep in two days. ![]() it seems that the wGetLogicalDriveList function doesn't function as expected in InnoSetup v5.x. however, the FLogicalDrives class works reliably across all scenarios and has undergone thorough testing. Code:
type
FLogicalDrives = interface(IUnknown)
'{73D9B3A3-6571-474E-B043-7DC8D3248538}'
procedure FCreate;
function Count: Integer;
function CDriveIndex: Integer;
function Letter(const Index: Integer): WideString;
function LetterToIndex(const Letter: WideString): Integer;
function IsRemovable(const Index: Integer): Boolean;
function MediaType(const Index: Integer): Integer;
function MediaTypeEx(const Index: Integer; out HealthStatus, Usage: Integer): Integer;
function SpaceFreeMB(const Index: Integer): Integer;
function SpaceAvailableMB(const Index: Integer): Integer;
function SpaceTotalMB(const Index: Integer): Integer;
end;
Code:
{ Drive Media Type }
const
HDD_MEDIA_TYPE_UNKNOWN = $0000;
HDD_MEDIA_TYPE_USB = $0001;
HDD_MEDIA_TYPE_SD = $0002;
HDD_MEDIA_TYPE_HDD = $0003;
HDD_MEDIA_TYPE_SSD = $0004;
HDD_MEDIA_TYPE_SCM = $0005;
HDD_MEDIA_TYPE_NVMe = $0006;
{ Drive Health }
const
HDD_HEALTH_STATUS_HEALTHY = $0000;
HDD_HEALTH_STATUS_WARNING = $0001;
HDD_HEALTH_STATUS_UNHEALTHY = $0002;
HDD_HEALTH_STATUS_UNKNOWN = $0005;
{ Drive Usage }
const
HDD_USAGE_UNKWOWN = $0000;
HDD_USAGE_AUTO_SELECT = $0001; // used for data storage.
HDD_USAGE_MANUAL_SELECT = $0002; // used if manually selected by an administrator at the time of virtual disk creation.
HDD_USAGE_RETIRED = $0004; // retired from use
HDD_USAGE_CACHE = $0005; // used as a cache for other devices.
Code:
{ LogicalDrives }
LogicalDrives.FCreate;
if LogicalDrives.Count > 0 then
begin
{ ListBox }
ListBox.FCreate(FMXForm.Handle);
ListBox.SetBounds(NSX(32), NSY(53), NSX(297), NSY(249));
ListBox.OnChange(@ListBoxOnChange);
if ImgList.Count >= 2 then
ListBox.ImageList(ImgList.Handle);
{ ListBox-Items }
SetArrayLength(ListBoxItems, LogicalDrives.Count);
ListBox.BeginUpdate; // BeginUpdate
for i := 0 to LogicalDrives.Count - 1 do
begin
ListBoxItems[i] := InitListBoxItemHandle;
ListBoxItems[i].FCreate(ListBox.Handle);
ListBoxItems[i].Text(LogicalDrives.Letter(i));
if (ImgList.Count >= 2) then
begin
if (i = LogicalDrives.CDriveIndex) then // C-Drive
ListBoxItems[i].ImageIndex(0)
else
ListBoxItems[i].ImageIndex(1);
end;
ListBox.AddItem(ListBoxItems[i].Handle);
end;
ListBox.EndUpdate; // EndUpdate
end else
MsgBox('"LogicalDrives" failded!', mbError, MB_OK);
. Last edited by BLACKFIRE69; 14-07-2024 at 02:10. |
| The Following 4 Users Say Thank You to BLACKFIRE69 For This Useful Post: | ||
| Sponsored Links |
|
#2
|
||||
|
||||
|
Testing:
guys, if any of you happen to have some free time and are using virtual machines other than VMware 17.x, could you please test this on them? ![]() Quote:
Last edited by BLACKFIRE69; 07-10-2023 at 08:38. |
|
#3
|
||||
|
||||
|
HI, Is it inno script project or compiler?
__________________
Search and Find |
| The Following User Says Thank You to ADMIRAL For This Useful Post: | ||
Behnam2018 (13-10-2023) | ||
|
#4
|
||||
|
||||
|
I tried to make it once when the sample was just made, but I couldn't. Even now, if I want to make it, I won't succeed. If possible, please complete it and share the code so that I can increase my ability to make this type of script.
Thankful
__________________
Search and Find |
| The Following User Says Thank You to ADMIRAL For This Useful Post: | ||
BLACKFIRE69 (13-10-2023) | ||
|
#5
|
||||
|
||||
|
Quote:
and audiofeel, created this scenario using this library. So, thanks to them Last edited by hitman797; 13-10-2023 at 10:02. |
| The Following 2 Users Say Thank You to hitman797 For This Useful Post: | ||
ADMIRAL (14-10-2023), BLACKFIRE69 (13-10-2023) | ||
|
#6
|
||||
|
||||
|
Quote:
The installation path selection section in windows 10 pro new Updates. it has a problem and does not work I tried to change the codes but it doesn't work
__________________
Search and Find Last edited by ADMIRAL; 14-11-2023 at 07:01. |
|
#7
|
||||
|
||||
|
thanks for answer but it's was about metro0 script that you posted
__________________
Search and Find |
|
#8
|
||||
|
||||
|
Quote:
after making a few changes to the code, you can make it work. however, if i'm correct, there're some aspects in the script that need further implementation. it would be better to ask the authors to complete the script. ![]() Code:
Edit1:
* Replace the current 'ListBoxOnChange' code with this.
procedure ListBoxOnChange(Sender: TObject);
var
ADir: String;
begin
if (FMXListBox[2].GetItemIndex > -1) then
begin
ADir := FMXEdit[1].GetText;
StringChange(ADir, ExtractFileDrive(ADir), FMXListBox[2].GetItemText(FMXListBox[2].GetItemIndex));
FMXLabel[197].Text(MinimizePathName(ADir, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width));
FMXEdit[1].Text(MinimizePathName(ADir, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width));
WizardForm.DirEdit.Text:= ADir;
FMXDiskUsage.SetDir(WizardForm.DirEdit.Text);
FMXLabel[82].Text(MbOrTb(FMXDiskUsage.FreeSpace, 1));
FMXLabel[85].Text(MbOrTb(FMXDiskUsage.FreeSpace, 1) + ' is available from the selected drive');
FMXArc[5].Angle(FMXDiskUsage.FreeSpace, FMXDiskUsage.TotalSpace);
end;
end;
procedure ListBx3OnChange(Sender: TObject);
var
ADir: WideString;
begin
if FMXListBox[3].GetItemIndex > -1 then
begin
ADir:= ExtractFileDrive(FMXEdit[1].GetText) + '\' + AddBackslash(FMXListBox[3].GetItemText(FMXListBox[3].GetItemIndex)) + '{#MyAppName}';
FMXLabel[197].Text(MinimizePathName(ADir, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width));
FMXEdit[1].Text(MinimizePathName(ADir, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width));
WizardForm.DirEdit.Text:= ADir;
FMXDiskUsage.SetDir(WizardForm.DirEdit.Text);
FMXLabel[82].Text(MbOrTb(FMXDiskUsage.FreeSpace, 1));
FMXLabel[85].Text(MbOrTb(FMXDiskUsage.FreeSpace, 1) + ' is available from the selected drive');
FMXArc[5].Angle(FMXDiskUsage.FreeSpace, FMXDiskUsage.TotalSpace);
end;
end;
Code:
Edit2: * Comment out the following line in the code. //FMXEdit[1].OnChange(@ListBoxOnChange); Code:
Edit3: * Replace the ListBoxOnChange event with ListBx3OnChange for the FMXListBox[3]. FMXListBox[3].OnChange(@ListBx3OnChange); Last edited by BLACKFIRE69; 14-07-2024 at 02:12. |
|
#9
|
||||
|
||||
|
Quote:
Thank you for your quick reply, but even with the edit's codes, I am still facing the same problem. Are there any problems for you with these codes in the script?
__________________
Search and Find |
|
#10
|
||||
|
||||
|
In the first test, my partitions and folders were not displayed at all, and by adding codes, I only encountered errors.
__________________
Search and Find |
|
#11
|
|||
|
|||
|
Weird... I installed the font to my system and now all is fine
![]() Sorry for the issues! Inno isn't my thing... |
|
#12
|
||||
|
||||
|
Quote:
Yes, it worked this time The path selection section works correctly, except that it does not show C drive folders for the first time, but the important thing is that the path can be selected. and add folder button works too. can you share the iss file?
__________________
Search and Find Last edited by ADMIRAL; 16-11-2023 at 09:56. |
| The Following User Says Thank You to ADMIRAL For This Useful Post: | ||
audiofeel (16-11-2023) | ||
|
#13
|
|||
|
|||
|
Everything is great and good, only I saw 2 big problems, one of them did not have the date of the watch
2. When I chose the installation location, it wrote the volume on the image, it wrote the same. 2. There were only problems, thanks for your good script |
| The Following User Says Thank You to Jahan1373 For This Useful Post: | ||
audiofeel (16-11-2023) | ||
|
#14
|
||||
|
||||
|
Quote:
and you missing the music button and counter app running.
|
| The Following User Says Thank You to hitman797 For This Useful Post: | ||
audiofeel (16-11-2023) | ||
|
#15
|
||||
|
||||
|
Quote:
As I said before, the test you sent works Can I have your iss file?
__________________
Search and Find |
![]() |
| 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 |