2

Having a problem with the following scenario under Windows 10:

  1. Inno Setup script has PrivilegesRequired=admin flag

  2. The initial installation worked fine without any problems

  3. Installed an update on which some .exe and software related local environment files (text files that are also installed in the software installation folder C:\Program Files\XYZ\) have been modified.

  4. Problem starts when running the software under the User account:

    a. When running under the User account: software sees the text files that have been installed with the initial installation (old files). However, the .EXE files are from the Update (new files)

    b. When running under the Admin account: no problem, all works fine and the software sees the new .EXE and text files

    c. Created a copy of the C:\Program Files\XYZ\ folder under the User account and ran the software: all works fine and the software sees the new .EXE and text files

[Setup]
DefaultDirName={pf}\XYZ\MyProgramName
PrivilegesRequired=admin
UsePreviousAppDir=false
AppendDefaultDirName=false

[Files]    
Source: E:\App1.exe; DestDir: {app}; Flags: ignoreversion; Check: InstStandalone
Source: E:\App2.exe; DestDir: {app}; Flags: ignoreversion; Check: InstStandalone

Source: {#MyInstlSourceDir}Hed\mastlca12i.hed; DestDir: {app}; Flags: ignoreversion
Source: {#MyInstlSourceDir}Hed\mastlca12m.hed; DestDir: {app}; Flags: ignoreversion
Source: {#MyInstlSourceDir}Hed\mastlca12Pi.hed; DestDir: {app}; Flags: ignoreversion
Source: {#MyInstlSourceDir}Hed\mastlca12Pm.hed; DestDir: {app}; Flags: ignoreversion

Should I set some special permissions when installing an Update?

Thank you in advance.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Vadim
  • 113
  • 8

1 Answers1

0

My wild guess is that your application writes to the files. If the application does not have an application manifest, it's considered a legacy application by Windows, which enables a compatibility mode. In the mode, when the application attempts to write files in its installation folder, where the user actually has no write access, the Windows redirects the writes to a virtual store. Next time the application is run, it reads the files from the virtual store, not from the original installation folder. So even if you update the original files, the application will still use its own copy from the virtual store.

For details, see Application installed with Inno Setup writes files to unknown location instead of its installation folder

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992