Karl_Seeger
Posts: 3
Joined: Thu Nov 03, 2005 4:52 pm

Adding users to an Install

I need to install a user (postgres) to a system as part of my install. All I need to do is pass a command line.....

net user postgres password /add

How best to do this? I don't know Java, VSB and am not interested in learning yet a 7th language! Can I do this with a .bat file? I also need to do this early in the install since I do start a service that needs to run as this login (three guesses what it is).

Thanks,

Karl "newguy" Seeger
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi Karl,

You could use a BAT file to pass the command line.

In order to do that create the BAT file and add it to the package. Then create a "New Installed Custom Action" type of custom action. Select as target the BAT file from the package.

You could schedule this custom action to be executed before the "StartServices" standard action, say under "RegisterComPlus".

Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
Karl_Seeger
Posts: 3
Joined: Thu Nov 03, 2005 4:52 pm

I added a Custom Action under RegisterComPlus but I still get an error. When I look at the Windows box the files have NOT been copyed on yet so its failing due to the file not being avalable.

What am I missing here?

-Karl
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi Karl,

The custom action fails because the files are not copied at the time the BAT is scheduled to be executed.

In order to avoid his problem, you could use a "New Attached Custom Action" type of custom action. The target of this custom action could be an EXE, DLL or Script file, that will launch the command line.

Here is an example of a VBScript that executes a command line:

Code: Select all

Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Exec("C:\Windows\notepad.exe")
All the best,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”