cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jpriyank
Level 3

Run a Custom Action

Hi everybody!!!! 🙂

I'm new to this community as well as to InstallShield. Can anybody help me with defining custom actions :

1. I need to run a VB Script as a custom action by calling it and not embedding it. this Vb Script creates a new folder. What should be the respond options and where should i place it in the sequence?

2. I also need to run a vbscript to delete the folder when i uninstall this folder. I've no idea to go about this how to go about it:( .

3. Also can anybody tell me the difference between embedding the VbScript in InstallScript and Calling the script. Which one is prefferred ann pros ad cons of both.

Thanks in advance...
Labels (1)
0 Kudos
(3) Replies
KathyMorey
Level 10

First, what kind of project are you using? In a Basic MSI project, you can create a folder using the CreateFolder table and can remove it using the RemoveFile table instead of using VBScript custom actions.

In InstallScript MSI, you can either use the MSI tables or you can create and remove a folder using InstallScript, again without using VBScript custom actions. In my opinion, using the inbuilt MSI tables is a better solution.
0 Kudos
jpriyank
Level 3

actually its just a demo. I've a vbscript around which I've to build a Setup.exe and uninstall.exe. So i've just taken a random script to try out things. Can you suggest what should I do in my case????
0 Kudos
cbragg
Level 7

If you 'embed' the script your package becomes self contained, you can pass it around without people having to take a script as well, plust you can easily import your package into major deployment tools. But if you need to reference a script from a path you can call an EXE custom action from a path referencing a directory, set the path up to point to cscript.exe and run the script as an argument to cscript.exe. Embedding is the best way to go though.

As for the delete folder business you need to look into the removefile table.
http://msdn.microsoft.com/en-us/library/aa371201(VS.85).aspx

Specifying no files will remove the folder instead. But be warned you need another entry to remove the files too
0 Kudos