Micheal
Posts: 7
Joined: Fri Mar 10, 2006 12:29 pm

Writing in to batch files.

Hi,

I will be installling some scriptlets in different directory structure. I want to register this scriptelts as we register like dll's that is not supported in AI. So how do u register scriptlet? one thing can be done is while installing the scriplets it should write in to some batch file like if we are installing test.sct in c:\test directory then the below line should be written in some batch file
regsvr32 C:\test\test.sct.

same the way with other scriptlets.

I am using Advanced Installer 4.1.2 licensed version.

Thanks
Micheal
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You can register the server scriptlets using an 2 EXE with Working Directory Custom Actions for *each* file that needs to be registered. One CA will register the scriptlet (when the file is installed), the other will unregister the scriptlet (when the file is uninstalled).

In what follows I shall describe the process for a single file ("Account.sct"). Follow these steps:

1. In the Files and Folders page, add all the ".sct" files to your project.

2. Switch to the Organization page. Notice that all the files have been added to a single Component. The name of this Component will be used subsequently to Condition the registration of the ".sct" files.

3. Switch to the Custom Actions page and make sure that the following items are visible in the tree control - "SelfRegModules" and "SelfUnregModules":
- Show Standard Action -> Before File Installation -> SelfUnregModules
- Show Standard Action -> Before Finalization -> SelfRegModules

4. Create a new EXE with Working Dir Custom Action scheduled on the "SelfRegModules" stage. Set the following properties for this CA:
- Working Dir: APPDIR
- Full Path : "[SystemFolder]regsvr32.exe" /s "[#Account.sct]" (use the "Edit" button and then the "File" button in order to select the file from your package).

If you do not specify the "/s" flag a message box will be displayed. Thus, for debugging your CA, remove the "/s" parameter from the above command.

- Execution Properties: "Synchronous execution, ignore return code"
- Execution Options: Deferred
- Execution Condition: $Account.sct > 2 (click the "..." button, then click the "Component Action" button and select the Component associated with your ".sct" file; note that it will *not* have the same name as in the Organization page; it could be "APPDIR" or "APPDIR\Account.sct" etc).

5. Create a new EXE with Working Dir Custom Action scheduled on the "SelfUnregModules" Standard Action. Set the following properties for this CA:
- Working Dir: APPDIR
- Full Path : "[SystemFolder]regsvr32.exe" /s /u "[#Account.sct]"
The "/s" flag has the same meaning as above.
- Execution Properties: "Synchronous execution, ignore return code"
- Execution Options: Deferred
- Execution Condition: $Account.sct = 2 (click the "..." button, then click the "Component Action" button and select the Component associated with your ".sct" file; note that it will *not* have the same name as in the Organization page; it could be "APPDIR" or "APPDIR\Account.sct" etc).

6. Repeat the steps 4-5 for each ".sct" file.

Regards,
Gigi
________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Micheal
Posts: 7
Joined: Fri Mar 10, 2006 12:29 pm

But this is not working, and i want to write in to batch file cant it be achieved.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
But this is not working, and i want to write in to batch file cant it be achieved.
Please give me more details about what is not working in my instructions form the previous post?

What i was trying to say is to add two custom actions (one to register the scriptlet other to unregister it) for each scriptlet file that you have added in the "Files and Folders" page. I don't understand why you need to create a batch file for this?

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”