Commands-questions (Setup.inf)

Beiträge: 1
Registriert: 19. Feb 2021, 09:52

Commands-questions (Setup.inf)

Beitrag von 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

Beiträge: 7645
Registriert: 13. Dez 2004, 23:10
Wohnort: Adendorf/Lüneburg

Re: Commands-questions (Setup.inf)

Beitrag von Hendrik_Ambrosius » 02. Mär 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: ... 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 Consultant
Mobile: +49 172 408 4447 |
Matrix42 AG | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany |

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


Zurück zu „Packaging“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast