Jump to content

Tom F

Members
  • Content Count

    211
  • Joined

  • Last visited

  • Days Won

    5

Tom F last won the day on March 12 2023

Tom F had the most liked content!

Community Reputation

80 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Tom F

    12.1 requiring me to uninstall 12.0?

    I wanted to add that despite many tries over the years, the migration assistant has never worked for me, even the new and "improved" ones provided occassionally. Perhaps if I select to Uninstall on the above screen, The assistant asks if I want to back up settings so I can re-apply them in 12.1?
  2. I hate to ask it because I've seen it asked for years and years. And, now I'm asking it ... again. And, believe me, I've looked and look in the EMB docs online and elsewhere and can't find an answer. When would the installer require me to uninstall 12, as shown below? This happens on the ISO as well as the web installer. Is this typical behavior?
  3. Tom F

    Alternative to VMWare??

    I'm hoping to use Virtual Box in place of VMWare Workstation Pro for development and testing. I'm hoping its snapshot feature has similar functionality to VMWare's. (And, hey, it's free, AFAIK!) But, to be honest, I don't know much about it yet and I haven't gone much further yet than thinking about it. Here's evidence that VMWare is dying. https://communities.vmware.com/t5/VMware-Workstation-Pro/High-CPU-usage-by-vmnat-exe-after-upgrade-to-VMware-Workstation/td-p/2992063
  4. Tom F

    Could this be an Indy Error?

    Why didn't you edit the input, changing the coordinates so that there is no confidentional information?
  5. Delphi will continue to stagnate. I think that AI and IDE support for C# and other mainstream languages will soon make Delphi programmers fall far behind the productivity and quality of their peers.
  6. Thanks for adding that reference, Remy. I wasn't aware of Delphi's System.DateUtils.DateToISO8601 and siblings, which is exactly what I needed!!! https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.DateUtils.DateToISO8601
  7. Thanks, Remy. I'm glad it wasn't something totally obvious I was not doing! 😉 Even the simple code below (which doesn't use an inifile) fails. I'd call that a genuine bug worthy of my reporting to EMB. Thanks again for your help on this and so many other things. procedure TForm1.Button1Click(Sender: TObject); var DateStr: String; DateTime: TDateTime; begin DateStr := DateTimeToStr(Now); if TryStrToDateTime(DateStr, {out} DateTime) then ShowMessage('Ok result: ' + DateTimeToStr(DateTime)) else ShowMessage('TryStrToDate failed'); end;
  8. Thanks, @Remy Lebeau. I always value your input. I can't get the simple code below to write and then successfully read a date on macOS Sonoma 14.2 on a MacMini (ARM). XCode version 15. Using Delphi version 12. It works fine on Windows 10 running as a 32-bit or 64-bit app. But on macOS, the TryStrToDateTime call returns false I don't doubt that I'm doing something wrong, but I can't figure out what. procedure TForm1.btnCreateClick(Sender: TObject); var MemIniFile: TMemIniFile; Filename: String; DateStr: String; begin Filename := IncludeTrailingPathDelimiter(TPath.GetDocumentsPath) + 'Test123.ini'; MemIniFile := TMemIniFile.Create(Filename, TEncoding.Unicode ); try DateStr := DateTimeToStr(Now); MemIniFile.WriteString('Version', 'SourceFileDate', DateStr); MemIniFile.UpdateFile; finally MemIniFile.Free; end; end; procedure TForm1.btnReadClick(Sender: TObject); var Filename: String; MemIniFile: TMemIniFile; IniFileDateTimeStr: String; DateTimeFromIniFile: TDateTime; begin Filename := IncludeTrailingPathDelimiter(TPath.GetDocumentsPath) + 'Test123.ini'; MemIniFile := TMemIniFile.Create(Filename, TEncoding.Unicode ); try IniFileDateTimeStr := MemIniFile.ReadString('Version', 'SourceFileDate', 'Missing'); finally MemInifile.Free; end; if IniFileDateTimeStr = 'Missing' then ShowMessage('IniFile entry was missing') else if TryStrToDateTime(IniFileDateTimeStr, {out} DateTimeFromIniFile) then ShowMessage('Inifile contained date: ' + DateTimeToStr(DateTimeFromIniFile)) else ShowMessage('TryStrToDateTime failed when called with ' + IniFileDateTimeStr); end; I've included the project source in an attached zip file. I've also attached the .ini file from the Mac. Test123.ini Complete project source.zip
  9. It surprised me to discover that sometimes those settings are changed by users! That's why I want my code to process this file (and others) regardless of machine settings.
  10. I'm trying to untangle a mess I created years ago in a macOS FMX program (formerly 32-bit and now Universal ARM 64-bit,) I've always used the current version of Delphi (now 12) and this app goes back 5+ years, so some of these files were created in earlier versions of Delphi and on older 32-bit versions of macOS. For years, my app created an IniFile for my program's use only, using TInifile.WriteDateTime. My two mistakes: I didn't specify the encoding of the IniFile, which can vary. WriteDateTime (AFAIK) uses the global FormatSettings, which can vary. So, I'm trying to figure out a way to reliably read the IniFile's TDateTime regardless of the defaults in effect when it was created or when it is being read. I'm planning for my app to try to open the file in TMemIniFile with different encodings (starting with the machine's default) and read the date with TMemIniFile.ReadString. I will then TryStrToDateTime with different FormatSettings (starting with the machine's default) until I get valid dates. This seems a bit brute force, but I don't know what else to do. My app is almost entirely US, with a few Canadian, European, Australian, and Asian users, so I hope to cover the majority of cases with a few formats. I know this may not give me 100% success. I've attached a sample of an .ini file I'm trying to reliably read. Here it is in UltraEdit in hex and characters: I've never spent much time with Unicode, but I think that the BOM FF FE here means it's Unicode. But when I open the attached .ini file, ReadString fails to find the Section and Identifier. I've tried different encodings in the TMemIniFile.Create. (I'm testing this code in FMX Windows 32.) I feel like I'm chasing my tail at this point. Am I missing something? Any suggestions on how to proceed? procedure TForm1.Button1Click(Sender: TObject); var IniFileDateTimeStr: String; IniFile: TMemIniFile; begin IniFile := TMemIniFile.Create('C:\Junk\Test.Ini', TEncoding.Unicode); // I have tried other encodings too IniFileDateTimeStr := IniFile.ReadString('Version', 'SourceFileDate', 'Missing'); ShowMessage(IniFileDateTimeStr); //<--- Always shows 'Missing' end; Test.ini
  11. Tom F

    Removing String

    @Lars Fosdal Ha! I actually literally LOL-ed on that. ChatGPT has changed my relationship to RegEx. As we know, it's not always correct, but, hey, what a great tool!
  12. It's not easy to figure out for newcomers, which I am. I struggled like you. There are many different ways to use the key, so finding the right way for our simple need (no CI, no server, command line) was quite difficult for me. Hopefully, this can help you: Below are the batch file lines we use. I don't know how much of this applies to you. Paths, app exe filename and ### will of course be different. Tech Support at Sectigo provided great email support on the dongle/key I purchased from them. (I split the single line below into 4 lines to avoid wordwrap on the forum. It's all one line "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /sha1 ############################ /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /n "MyCompanyName, LLC" "C:\Users\user1\Documents\Project1\bin\AppName.exe" IF %ERRORLEVEL% NEQ 0 GOTO ERROR1 "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" verify /pa "C:\Users\user1\Documents\Project1\bin\AppName.exe" The ### above is the thumbprint of the certificate fingerprint. It's found on the details tab as shown in the attached screen capture. (TBH, I can't recall where I found this screen, whether in the dongle app or a right-click on a certificate file or something.) Something similar can be done in the INNO IDE and command line versions. We have the dongle on a local machine. We have to enter the token password once, the first time we run the above after booting that machine.
  13. Tom F

    Obfuscating secrets

    We use TurboPower's encryption tools (available for free under Tools > Package Manager for these kinds of mild protection from prying eyes. GetKey in the code below just returns the key we use. I'm sure purists will find all sorts of problems with the code below (including the FreeAndNil). But, hey, you do you and we'll do us. This isn't a banking app, it's obfuscation.
  14. Tom F

    How do I execute code after FormShow ?

    We've used a flag for years. It takes, what?, about one minute to implement and has an almost zero risk of being buggy. Our advice is to take the easy road here: use a flag.
  15. Tom F

    macOS Sonoma and UI layout

    The code above indeed does come from Embarcadero. I searched the site for GlobalUseMetal in the past year to find this. See https://quality.embarcadero.com/browse/RSP-42424.
×