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
FOLLOW US
Get the latest news in Application Packaging