This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Passing directory to Custom Action executable
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 22, 2008
01:33 PM
Passing directory to Custom Action executable
I have a custom action which passes in an argument of a directory (the location of where the files to be processed reside) to an executable which processes files.
I know the property of this folder [REPORTSERVER1] and the actual location of the folder is C:/Program Files/Program1/.
My issue is when I pass the argument with no quotes ( -directory=[REPORTSERVER1] ) I get an error due to the space between Program and Files as it treats C:/Program as the argument I'm passing.
If I do quotes around it ( -directory="[REPORTSERVER1]" ) I still get an error but now it gets the whole path but leaves a quote mark at the end like this:
C:/Program Files/Program1"
Is there some other combination of quotes/or tick marks that I need?
I know the property of this folder [REPORTSERVER1] and the actual location of the folder is C:/Program Files/Program1/.
My issue is when I pass the argument with no quotes ( -directory=[REPORTSERVER1] ) I get an error due to the space between Program and Files as it treats C:/Program as the argument I'm passing.
If I do quotes around it ( -directory="[REPORTSERVER1]" ) I still get an error but now it gets the whole path but leaves a quote mark at the end like this:
C:/Program Files/Program1"
Is there some other combination of quotes/or tick marks that I need?
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 22, 2008
03:38 PM
Why don't you try MSI property: [ProgramFilesFolder] for "C:\Program Files"?
In your case, you can set:
-directory="[ProgramFilesFolder]\Program1"
In your case, you can set:
-directory="[ProgramFilesFolder]\Program1"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 22, 2008
03:50 PM
Thanks for the suggestion however, the location is determined by user input so it won't always be the same. I know the location where it will install on my local test machine. The user basically picks which instance of SQL Server includes Reporting Services. If I physically put in the location with single quotes around it, it works fine so I tried it single quotes around the [REPORTSERVER1] property but that doesn't seem to work.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 22, 2008
04:28 PM
Can you check the value of REPORTSERVER1 property (via MessageBox or in the log file) if it inherit the quotation from user input?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 23, 2008
11:28 AM
I have run into the same issue. Since the property for a path has the closing slash, the second quote is "escaped" and therefore it doesn't think you have a quote at the end of the string, if that makes sense. That also explains why you get C:/Program Files/Program1" with an ending quote but no slash as your value.
Try -directory="[REPORTSERVER1] " with a space before the closing quote and see if that works for you.
Try -directory="[REPORTSERVER1] " with a space before the closing quote and see if that works for you.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 23, 2008
04:19 PM
I tried using -directory="[REPORTSERVER]\ReportServer" and this ended up working. I realized that I'll always know the secondary folder will be called ReportServer so the only variable was the [REPORTSERVER] property and that it is determined by the directory the user picks anyway so this worked out.
Thanks for the help!
Thanks for the help!
![](/skins/images/D3004062EE959BB5114D71A9BAF91CB3/responsive_peak/images/icon_anonymous_message.png)