[Run] section skipifdoesntexist absolute path

29 views
Skip to first unread message

Mark -

unread,
Jul 30, 2025, 7:48:14 PMJul 30
to innosetup
Hello,

A bit confused.

Two checkboxes are displayed.
 
I have this in the run section

 Filename: ExpandConstant('{app}') + '\Help Files\English\Getting Started.pdf'; Description: "View the ""Getting Started"" file"; Flags: shellexec postinstall unchecked skipifdoesntexist
 Filename: ExpandConstant('{app}') + '\Help Files\English\Getting Started Demo.pdf'; Description: "View the ""Getting Started"" file"; Flags: shellexec postinstall unchecked skipifdoesntexist

One file is deleted in the code section.

help file reads: skipifdoesntexist must be an absolute path

my first attempt
"{app}\Help Files\English\Getting Started.pdf" 

does not work so I went to ExpandConstant and it does not work.
Does it really have to be, example c:\program files\here\Help Files\English\Getting Started.pdf  for the "Filename" ?

I see both files installed and one is deleted. Visually, the file to be deleted, does not disappear in the Explorer window until a second after the postinstall dialog is displayed.


Thanks,

Mark



Gavin Lambert

unread,
Jul 30, 2025, 8:39:04 PMJul 30
to innosetup
On Thursday, July 31, 2025 at 11:48:14 AM UTC+12 Mark - wrote:
 Filename: ExpandConstant('{app}') + '\Help Files\English\Getting Started.pdf'; Description: "View the ""Getting Started"" file"; Flags: shellexec postinstall unchecked skipifdoesntexist
 Filename: ExpandConstant('{app}') + '\Help Files\English\Getting Started Demo.pdf'; Description: "View the ""Getting Started"" file"; Flags: shellexec postinstall unchecked skipifdoesntexist

Using ExpandConstant like that is not valid syntax.  ExpandConstant can only be used in [Code].

my first attempt
"{app}\Help Files\English\Getting Started.pdf" 

That is correct syntax. 

I see both files installed and one is deleted. Visually, the file to be deleted, does not disappear in the Explorer window until a second after the postinstall dialog is displayed.

"skipifdoesntexist" applies to the execution, not the display of the checkbox, so it doesn't really make sense on postinstall and isn't what you want anyway.

You should do the following:

1. Make only one [Run] entry without skipifdoesntexist that refers only to Getting Started.pdf.
2. Remove your code that deletes the "wrong" file.
3. On the [Files] entry for Getting Started Demo.pdf, set its DestName to Getting Started.pdf.
4. Use Check functions or Components to specify which of the two pdf [Files] entries actually get installed (you want only one or the other).

Mark -

unread,
Jul 30, 2025, 9:33:16 PMJul 30
to inno...@googlegroups.com
Thanks Gavin. 

--
You received this message because you are subscribed to a topic in the Google Groups "innosetup" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/innosetup/Pwoh0XmLN48/unsubscribe.
To unsubscribe from this group and all its topics, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/49ee6a20-5568-4077-89e8-b2de621a1c31n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages