Alsalam alikom wa ra7mat Allah wa barakatoh
Recently, we have ran into a problem when we had to modify Install Shield script to programatically configure some security policies while being installed. We thought this information may come in handy for some of you. However, I know not much people will be interested in such a detailed problem...
Our deliverables will be:
- a .inf file a security template file that contains the proposed configurations
- a .sdb file (Security DataBase) this is able to inspect the client policies and modify/configure it.
- a .rul file (Install Shield Script) that is able to install such configurations
Let's start one by one,
If you didn't change the default paths, you will find those files in My DocumentsSecurity
Now we've created the .inf and .sdb files... the only remaining task is to write the script that will apply the configurations
For those not familier with IShield script, what we basically want to do is to execute this command:
C:WindowsSystem32secedit.exe /configure /db "C:....Tmpl Trial DB.sdb"
There are a couple of things we don't know about,
So, here is a sample script:
szApplication = WINDIR ^ "system32\secedit.exe";
szParameters = "/configure /db "" + INSTALLDIR + "Tmpl Trial DB.sdb"";
LaunchApp(szApplication, szParameters);
N.B. Of course to run the installer we need a user who has privileges to configure the security policy.
That's all...
Happy coding :)
Alsalam alikom wa ra7mat Allah wa barakatoh
Recently, we have ran into a problem when we had to modify Install Shield script to programatically configure some security policies while being installed. We thought this information may come in handy for some of you. However, I know not much people will be interested in such a detailed problem...
Our deliverables will be:
- a .inf file a security template file that contains the proposed configurations
- a .sdb file (Security DataBase) this is able to inspect the client policies and modify/configure it.
- a .rul file (Install Shield Script) that is able to install such configurations
Let's start one by one,
- Open Start Menu -> Run -> MMC and hit enter
- File menu -> Add/Remove Snap-in
- Press Add and choose "Security Configuration and Analysis" then hit Add
- Choose "Security Templates" and hit Add... then Ok to close the main dialog
- Expand Security Templates and Add a new template as in the picture
- Choose a name (Tmpl Trial for example) and description then hit okay
- Now expand the newly created template, and configure it as you wish.
- Right click on the template, save as and choose any place you want to save it in (by default a file will have been created for you)
- Right click on the Security Configuration and Analysis, choose Open Database
- Type a name for the data base you want to create, let's call it Tmpl Trial DB
- It will ask you to pick a template for it, choose the .inf file you have saved earlier (in step 8).
- bingo, just close the mmc and don't save the Console1 if it asked you to :)
If you didn't change the default paths, you will find those files in My DocumentsSecurity
Now we've created the .inf and .sdb files... the only remaining task is to write the script that will apply the configurations
For those not familier with IShield script, what we basically want to do is to execute this command:
C:WindowsSystem32secedit.exe /configure /db "C:....Tmpl Trial DB.sdb"
There are a couple of things we don't know about,
- The path of the Windows Directory... you can replace that part with WINDIR macro
- The path of the .sdb file, you can make sure it's being copied to the installation directory, and then you can use INSTALLDIR macro
So, here is a sample script:
szApplication = WINDIR ^ "system32\secedit.exe";
szParameters = "/configure /db "" + INSTALLDIR + "Tmpl Trial DB.sdb"";
LaunchApp(szApplication, szParameters);
N.B. Of course to run the installer we need a user who has privileges to configure the security policy.
That's all...
Happy coding :)
Alsalam alikom wa ra7mat Allah wa barakatoh
you were tagged by me to say 8 facts no one knows about you and tag another 8 of your friends
ReplyDelete