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: Custom Action condition based on existance of file
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)
Anonymous
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 15, 2010
12:21 PM
Custom Action condition based on existance of file
How can I add a condtion for a Custom Action that checks if a certain file or folder exists. Like equivalent to:
if C:\test exists run this action.
By the way, I need to check for the existence of the folder at the very end of the installation so I can't do a System Search because although that folder may exist at the beginning of the Uninstall, it may not exist by the end of the install.
Thanks
if C:\test exists run this action.
By the way, I need to check for the existence of the folder at the very end of the installation so I can't do a System Search because although that folder may exist at the beginning of the Uninstall, it may not exist by the end of the install.
Thanks
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 15, 2010
03:48 PM
System search is the built-in support in Windows Installer to check for the existence of a file or folder. Since it won't meet your requirements, you will need to use a custom solution:
1. You can create a custom action whose sole purpose is to check for the existence of the file/folder and to set a property. Then use this property to condition your original custom action.
2. You can modify the logic of your original custom action so that it itself will do a check on the existence of the file/folder.
Regards,
-Ajay
1. You can create a custom action whose sole purpose is to check for the existence of the file/folder and to set a property. Then use this property to condition your original custom action.
2. You can modify the logic of your original custom action so that it itself will do a check on the existence of the file/folder.
Regards,
-Ajay
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 08, 2010
12:34 PM
I dont know if posting on an old post will work, but i will try!
I have two custom actions that are throwing warnings ("The Custom Action in the InstallExecuteSequence table is run from an installed file. To run the custom action successfully, you may need to have a condition that checks if the source file is installed locally."
So the custom actions work fine, but i see where i could be setting a condition in the Custom action under "Install Exec Condition" i just have never quite gotten the hang on condiitons, though i have tried many times.
what would be the syntax to check if the file has already been installed? and to run the custom action if it has been installed?
thanks for any help!
I have two custom actions that are throwing warnings ("The Custom Action in the InstallExecuteSequence table is run from an installed file. To run the custom action successfully, you may need to have a condition that checks if the source file is installed locally."
So the custom actions work fine, but i see where i could be setting a condition in the Custom action under "Install Exec Condition" i just have never quite gotten the hang on condiitons, though i have tried many times.
what would be the syntax to check if the file has already been installed? and to run the custom action if it has been installed?
thanks for any help!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2010
11:08 AM
To get more familiar with conditions, please read the following help topic:
Conditional Statement Syntax
http://msdn.microsoft.com/en-us/library/aa368012(VS.85).aspx
An example of a condition that you can use to prevent your custom action from running during any maintenance operation is 'Not Installed'. Or if you wanted to only prevent the custom action from running during an uninstall, then you could use 'REMOVE="ALL".'
Conditional Statement Syntax
http://msdn.microsoft.com/en-us/library/aa368012(VS.85).aspx
An example of a condition that you can use to prevent your custom action from running during any maintenance operation is 'Not Installed'. Or if you wanted to only prevent the custom action from running during an uninstall, then you could use 'REMOVE="ALL".'
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)