Commands-questions (Setup.inf)

Post Reply
Seth
Posts: 1
Joined: 19. Feb 2021, 09:52
Contact:

Commands-questions (Setup.inf)

Post by Seth » 19. Feb 2021, 12:38

Hello All,

I'm new in the scripting in Setup.inf and have some questions.

I have to modify some packages to prevent run them if a client is in a special subnet currently, or have other special triggers. I have found nothing about the "if then else " structure if i have to use OR and AND operand inside one IF statement.

With package editor i see no way to insert AND , OR to the command. (is it possible if i type it at the field Value? Is it a right way to edit setup.inf in and editor then typing commands manually?

What operand i have to use for AND and what for OR ? As i found in this forum the | is means OR, but what used for AND ( || ? )

Are there any available documentation with command references?

At last, what way is the best to check the following in setup.inf. : get the current computer's name then check if it is inside a list ("database") of some computer names or not?

These are lot of questions i know. Thanks
Seth

User avatar
Hendrik_Ambrosius
Moderator
Moderator
Posts: 7962
Joined: 13. Dec 2004, 23:10
Location: Adendorf/Lüneburg

Re: Commands-questions (Setup.inf)

Post by Hendrik_Ambrosius » 02. Mar 2021, 18:08

This is an example for and IF-AND:

If %ErrorLevel% <> "3010" & %ErrorLevel% <> "0" Then "SET:InstallationError" EndIf

Or is "|" instead of "&":

DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Office\9.0\Common\InstalledElevated,{00010407-78E1-11D2-B60F-006097C998E7}") == "1" | DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Office\9.0\Common\InstalledElevated,{00020407-78E1-11D2-B60F-006097C998E7}") == "1"

You can use notepad or whatever editor you prefer.

Link to documentation: https://helpfiles.matrix42-web.de/2020_ ... ements.htm

Check against list of computer in a file can be done via DoesTextInFIleExist:

DoesTextInFileExist ("<Text>", "<Filename>")
Returns "1" , if the text does exist in the file, "0" otherwise. Upper/Lowercase does not matter.
Example: If DoesTextInFileExist ("Database1" , "TNSNAMES.ORA") == "1" Then "DatabaseExists" Else "DatabaseDoesNotExists" EndIf
Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com

Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.

Post Reply

Return to “Packaging”

Who is online

Users browsing this forum: No registered users and 4 guests