Andrew Truckle
Andrew Truckle

Reputation: 19197

Directive or parameter "Check" expression error: Can only call function "ExpandConstant" within parameter lists

I have this in my [ISPP] section:

; Help Documentation download URL
#define HelpDocSetupURL "https://www.publictalksoftware.co.uk/downloads/PublicTalksHelpDocumentationSetup.exe"

I have this in my [FILES] section:

Source: "{tmp}\HelpDocSetup.exe"; \
    DestDir: "{app}"; \
    Flags: external deleteafterinstall; \
    Tasks: downloadhelp; \
    Check: DwinsHs_Check( ExpandConstant('{tmp}\HelpDocSetup.exe'), {#HelpDocSetupURL}, 'My_Setup', 'Get', 0, 0 )

When I compile I get an error:

Line 441: Directive or parameter "Check" expression error: Can only call function "ExpandConstant" within parameter lists.

I can use the literal path but how can I use my #define?


Update

Thus we are not allowed to use a preprocessor directive in this context. At the moment I am using the literal path instead.

Upvotes: 1

Views: 383

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202594

The error message you get is confusing.

After preprocessor you will get this code:

Check: DwinsHs_Check( ExpandConstant('{tmp}\HelpDocSetup.exe'), https://www.example.com/downloads/PublicTalksHelpDocumentationSetup.exe, 'My_Setup', 'Get', 0, 0 )

What is clearly a syntax error. The code misses quotes.

You want this:

Check: DwinsHs_Check( ExpandConstant('{tmp}\HelpDocSetup.exe'), '{#HelpDocSetupURL}', ...)

Upvotes: 1

Related Questions