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
- :
- FILE_EXISTS trouble
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
‎Nov 23, 2011
01:02 PM
FILE_EXISTS trouble
Hi,
I am having a problem with the 'Is' function within my install-script. I can not recognise the existence of a file which clearly exists on my disk. The reason for this is the space character within the specified path. If I rename the "My Stuff" directory "MyStuff", the 'Is' function call works as expected.
if (Is(FILE_EXISTS, "C:\My Stuff\MyFile.txt") == TRUE) then
doMyStuff();
end;
Can someone please tell me how to escape the space character? (My attempts to do so thus far have been unsuccessful) Thanks.
I am having a problem with the 'Is' function within my install-script. I can not recognise the existence of a file which clearly exists on my disk. The reason for this is the space character within the specified path. If I rename the "My Stuff" directory "MyStuff", the 'Is' function call works as expected.
if (Is(FILE_EXISTS, "C:\My Stuff\MyFile.txt") == TRUE) then
doMyStuff();
end;
Can someone please tell me how to escape the space character? (My attempts to do so thus far have been unsuccessful) Thanks.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 23, 2011
01:12 PM
If you have a text file such as 'C:\My Test\test Copy.txt', this code should work:
The problems with your code were:
if (Is(FILE_EXISTS, "C:\\My Test\\test Copy.txt")) then
MessageBox("File Exists", 0);
endif;
The problems with your code were:
- there was no escape sequence for '\',
- '==' instead of '=' .. In fact you don't need it.
- end; instead of endif;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 23, 2011
01:24 PM
Thanks for your input. I am out of the office at present and entered a code snippet from 'memory' to describe the problem in simple terms. I think my actual code does not have all the flaws identified in this snippet, although it does exhibit some.
I will follow your suggestions tomorrow and hope for success.
I will follow your suggestions tomorrow and hope for success.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 23, 2011
01:28 PM
🙂 .. Ok, I should have guessed that...Anyway, just for fun, I tried my code in a new sample, it works, so you should be able to use it as it is.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)