PDA

View Full Version : If Then Logic



ender
05-05-2013, 09:27 PM
I'm trying to have a validation check for folder name based on if a service is installed. I can get it to partially work, however its not 100%.

The attached screen shot is not the one i started with, but is an example. The logic is only half working; only can get one validation to work. I have tried If Then, If And Then, etc.

Thoughts?

linder
05-06-2013, 12:14 AM
Hello,

To be frank, I don't understand the question, sorry :(

Why are you using "If %SERVICE% Equals "1" on Position "1" Then"? Only use this to verify the state of a bitfield.

And I don't understand the logic behind the code snippet. What is it supposed to do? Let me know what you need and we can develop a small demo for you.

BTW, I would suggest to download the "Learning SetupBuilder Part I" manual. It comes with quite a few interesting examples, tips and tricks.

Friedrich

ender
05-06-2013, 07:21 AM
If the service is detected I was trying to make it required to backup files related to the service; if the service was not detected, it woulld skip the logic.

It will work using the if the folder exists, however, was trying to make it error proof by adding an addtional check.

For example, if the Parent folder has multiple sub-folders, and the wrong one is choosen it will still be a valid path. Was trying to find a way to add an extra control; which is why I was trying to add the speific name of the folder required.

linder
05-06-2013, 07:33 AM
So the user enters (or selects) an existing folder in one of your wizard dialogs and you check if that folder contains a specific "service" name?

Friedrich

ender
05-06-2013, 08:07 AM
Trying to make a single installer; for users who have the service installed and for thoes who do not have the service installed. Want to avoid having two seperate installers. If the installer detects the service it will prompt for the valid folder to backup associated with the service. If the service is not detected, it will skip this logic.

The "If Folder" works great, but does not verify if its the correct folder. Trying to add an additional validation check to verify the user provided the correct location.

linder
05-06-2013, 08:22 AM
What determines the "correct" location? Does the correct location contain the service name? For example: C:\Program Files (x86)\CoolApp\Accounting Service A

In this case, your logic to use "If Variable Contains..." is okay and can be used to check if the entered folder name contains a specific service identifier. The "If Folder" Statement can only check if a specific folder does exist.

Friedrich

linder
05-06-2013, 08:50 AM
BTW, but of course, the above detection logic is suboptimal. If you have full control over the deployment process, I would not do it this way. The recommended method is to write/read this kind of information to/from the Windows registry.

Friedrich