[InstallDelete] section not executed

838 views
Skip to first unread message

iLens

unread,
May 13, 2021, 7:58:28 AM5/13/21
to innosetup
My compiler output shows
*** Starting compile.  [12:45:00]

[ISPP] Preprocessing.
[ISPP] Preprocessed.

Parsing [Setup] section, line 2
Parsing [Setup] section, line 3
Parsing [Setup] section, line 4
Parsing [Setup] section, line 5
Parsing [Setup] section, line 6
Parsing [Setup] section, line 7
Parsing [Setup] section, line 8
Parsing [Setup] section, line 9
Parsing [Setup] section, line 10
Parsing [Setup] section, line 11
Parsing [Setup] section, line 12
Parsing [Setup] section, line 14
Parsing [Setup] section, line 16
Parsing [Setup] section, line 17
Parsing [Setup] section, line 18
Reading file (LicenseFile)
Reading file (WizardImageFile)
   File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNIMAGE.BMP
Reading file (WizardSmallImageFile)
   File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNSMALLIMAGE.BMP
Preparing Setup program executable
Reading default messages from Default.isl
Parsing [LangOptions], [Messages], and [CustomMessages] sections
   File: C:\Program Files (x86)\Inno Setup 5\Default.isl
   Messages in script file
Reading [Code] section
Parsing [Tasks] section, line 2 of I:\Documents\Development\PCS\Distribution\PCS_Common.iss
Parsing [Icons] section, line 59 of I:\Documents\Development\PCS\Distribution\PCS_Common.iss
Parsing [Icons] section, line 60 of I:\Documents\Development\PCS\Distribution\PCS_Common.iss
Parsing [Icons] section, line 81
Parsing [InstallDelete] section, line 34
[more]

this section says
[InstallDelete]
Type: filesandordirs; Name: "{localappdata}\PCS\Honours;"


The debug output shows 
12:45:47.866]   *** Setup started
[12:45:52.316]   Setup version: Inno Setup version 5.5.9 (a)
[12:45:52.321]   Original Setup EXE: I:\Documents\Development\PCS\Distribution\PhotEx_Install.exe
[12:45:52.323]   Setup command line: /SL5="$240AAE,8604950,57856,I:\Documents\Development\PCS\Distribution\PhotEx_Install.exe" /SPAWNWND=$2B0AFC /NOTIFYWND=$610982 /DEBUGWND=$803A6 
[12:45:52.325]   Windows version: 10.0.19042  (NT platform: Yes)
[12:45:52.327]   64-bit Windows: Yes
[12:45:52.328]   Processor architecture: x64
[12:45:52.329]   User privileges: Administrative
[12:45:52.332]   64-bit install mode: No
[12:45:52.341]   Created temporary directory: C:\Users\Phil\AppData\Local\Temp\is-UAMPC.tmp
[12:45:58.791]   Starting the installation process.
[12:45:58.800]   Directory for uninstall files: C:\Program Files (x86)\PhotEx
[12:45:58.807]   Will append to existing uninstall log: C:\Program Files (x86)\PhotEx\unins000.dat
[12:45:58.813]   -- File entry --
[12:45:58.815]   Dest filename: C:\Program Files (x86)\PhotEx\unins000.exe
[12:45:58.820]   Time stamp of our file: 2021-05-13 12:45:51.262
[12:45:58.822]   Dest file exists.
[12:45:58.824]   Time stamp of existing file: 2021-05-13 12:41:47.123
[12:45:58.826]   Version of our file: 51.52.0.0
[12:45:58.916]   Version of existing file: 51.52.0.0
[12:45:58.918]   Installing the file.
[12:45:58.922]   Uninstaller requires administrator: Yes
[12:45:58.924]   Leaving temporary file in place for now.
[12:45:58.929]   -- File entry --

[more FIle entries]
[Icon entries]
[12:46:04.745]   Installation process succeeded.
[12:46:04.748]   Need to restart Windows? No
[12:46:06.734]   Deinitializing Setup.
[12:46:06.796]   *** Setup exit code: 0


The debug log doesn't contain the string "Honours" and the directory is not deleted.

How do I fix this?

Martijn Laan

unread,
May 13, 2021, 9:20:43 AM5/13/21
to inno...@googlegroups.com
The ; inside the quotes looks wrong to me. This means you're telling it to delete Honours; and not Honours.

Greetings,
Martijn

> Op 13 mei 2021 om 13:58 heeft 'iLens' via innosetup <inno...@googlegroups.com> het volgende geschreven:
>
> "{localappdata}\PCS\Honours;"

Jernej Simončič

unread,
May 13, 2021, 9:30:57 AM5/13/21
to 'iLens' via innosetup on [innosetup]
On Thursday, May 13, 2021, 13:58:28, 'iLens' via innosetup wrote:

> Type: filesandordirs; Name: "{localappdata}\PCS\Honours;"

You probably don't want that ; inside the quotes, but …

> [12:45:52.329] User privileges: Administrative

… that [InstallDelete] section will not work as expected anyway, because your setup is running in administrative mode while accessing user-specific folders (if you don't set PrivilegesRequired, or if it's set to admin, you should never use any of the {user*} constants, nor {localappdata}, since the user running the setup might not be the user running the program).

--
< Jernej Simončič ><><><><>< https://eternallybored.org/ >

If there is a wrong thing to say, one will.
-- Hartig's "How Is Good Old Bill?" Didn't you know we're divorced Law

iLens

unread,
May 14, 2021, 3:15:48 AM5/14/21
to innosetup
Many thanks = removing the quotes did it 

Please can you explain the issue with administrative mode - my installer installs files in Program Files and also local AppData

Gavin Lambert

unread,
May 14, 2021, 3:56:10 AM5/14/21
to inno...@googlegroups.com
On 14/05/2021 7:15 pm, 'iLens' wrote:
> Please can you explain the issue with administrative mode - my installer
> installs files in Program Files and also local AppData

As already explained, you simply can't do that.

You must choose whether you want an admin install => only install
machine-wide files, or a user install => only install user-specific files.

{pf} is machine-wide.
{localappdata} is user-specific.

When installing machine-wide, you can't (safely) install files to
{localappdata} or any {user*} path. Instead, you have to make your
application detect that these files are missing on startup and then
create them at that point. (If the files are hard to create from
scratch, you can copy them from templates that you did install to {app}.)

Otherwise, you have a broken installer -- it will appear to work
provided that the user who runs the installer is the same one who runs
the app, but there are many scenarios when these will be different users
and your app will not be able to find the files it wants and has to be
able to generate them anyway.
Reply all
Reply to author
Forward
0 new messages