2

I am currently developing an internal tool using Delphi.

If I call the project and therefore the .exe

RecUtil

It runs fine with no intervention. However if I name the project

RecUpdate

It requires user intervention to allow it to run.

This is a command line utility, the only thing that changes between compiles is the filename of the project and by extension of the .exe.

Essentially once I go over the 8.3 limit I get different behaviour on the same .exe.

Does Delphi compile an .exe differently based on the length of the filename?

I am using Delphi 10.4

If I rename the file after compilation everything is fine it works like normal.

Toby Allen
  • 10,997
  • 11
  • 73
  • 124
  • 4
    What do you mean exactly by "requires user intervention"? Does a dialogue pop up? Does a setting need to be changed? Also, where are you doing the renaming - in some application setting in Delphi? Does the same happen if you rename the file in Windows Explorer after compiling? – IMSoP Feb 04 '23 at 17:49
  • A Dialog pops up asking if I want to run the application. – Toby Allen Feb 04 '23 at 17:52
  • 2
    Ok, and what does the dialogue say? – IMSoP Feb 04 '23 at 18:14
  • 1
    Some security or compatibility application on your computer probably has a whitelist or blacklist. The name of the EXE in itself has no significance, of course. And the length of it certainly doesn't matter. (Another possibility is that your program cares. Maybe you have code like `if Length(ExtractFileName(Application.ExeName)) > 12 then DoSomething else DoSomethingElse`.) – Andreas Rejbrand Feb 04 '23 at 18:14
  • 5
    UAC includes some not perfect detection for installers partially based on filenames. Often if just changing the name triggers UAC on a new system it is due to this. See: https://stackoverflow.com/questions/28239808/windows-installer-detection-whats-the-full-list-of-keywords – Brian Feb 04 '23 at 19:25
  • 2
    Answer to the question: No! – Delphi Coder Feb 04 '23 at 19:44
  • 3
    To avoid UAC/InstallerDetection, simply give the app a manifest with a `requestedExecutionLevel` specified. This can be handled in the [Application Manifest](https://docwiki.embarcadero.com/RADStudio/en/Application_Options#Manifest_File_.28Windows_Only.29) section of the project options. – Remy Lebeau Feb 05 '23 at 01:08
  • Thanks @Brian I think that might be it. Also Remy I will set the application Manifest. – Toby Allen Feb 05 '23 at 08:02
  • 1
    Just to explain @Brians comment. Windows triggers the UAC for filenames containing certain fragments. The simplest thing is to rename it to not have words such as install, setup, utility, device, driver (just to be sure). – Rohit Gupta Feb 05 '23 at 14:09
  • @RohitGupta Not just file names, but also version info resources, and other string resources, too. However, Microsoft doesn't publish a complete list of keywords it looks for, so the *simplest* (and *correct* and *recommended*) solution is to specify a UAC manifest instead, then the installer detection is disabled, so filename/keywords won't matter at all and can be whatever you want. – Remy Lebeau Feb 06 '23 at 18:43

1 Answers1

0

The answer to this is entirely to do with the words in the .exe name and not the number of characters.

I was naming my .exe recipeUpdate.exe which seems to trigger this UAC issue.

I removed the word update and it works fine.

Toby Allen
  • 10,997
  • 11
  • 73
  • 124
  • The issue is triggered only if you don't supply a UAC manifest, which (among other things) disables this keyword detection. – Remy Lebeau Feb 06 '23 at 18:45