chandan Koushik wrote:
> Hi All,
> I apologize for posting this if it has been answered several times but I am
> unable to get this working.I am using wixV3 .I just want to call a vbscript
> file which sets permission for user.It takes folder name as argument.
> when i run it from the command line using cscript 
> c:\>cscript setdirpermissions.vbs "c:\fonts"   the permissions to fonts
> folder gets changed.
> But when i try this in wix .this does not happen.
> <!--binary tag-->
> <Binary Id="vbscript" SourceFile="SetDirectoryPermissions.vbs"/>
> <!--custom action-->
> <CustomAction Id="SetAnonPerm" BinaryKey="vbscript" Execute="deferred"
>                                          ExeCommand="&quot;C:\fonts&quot;" 
> Return="check" />
> <!--Installexecutesequence -->
> <Custom Action="SetAnonPerm" After="InstallFinalize">NOT Installed</Custom>
>
> And even the Other approach also fails
> <!--custom action-->
> <CustomAction Id="SetAnonPermScript" Property="MNANONPERMSCRIPT"
> Value="&quot;SetDirectoryPermissions.vbs&quot;" />
> <Property Id="cscriptlaunch">cscript</Property>
> <CustomAction Id="SetAnonPerm" Property="cscriptlaunch"
> ExeCommand="[MNANONPERMSCRIPT]" Return="ignore" />
> <!--Installexecutesequence -->
> <Custom Action="SetAnonPermScript" After="InstallFinalize">NOT
> Installed</Custom>
> <Custom Action="SetAnonPerm" After="SetAnonPermScript">NOT
> Installed</Custom>
>
> The Script does not get executed .Please Help and suggest me the correct way
> to call the vb script at the end of installation.
>
> Regards,
> Chandan
>                       
I don't know if this will help you (I only did a few setup projects in
my like so I'm very new to this), but I have several cases where I used
VBScript custom actions. I needed it to extract the installation path
from some path to a file, stored somewhere in the registry. Basically I
defined a  property in the wix project and than set it's value in the
VBScript. I included the vbscript file as binary resource.

Perhaps if you modify the VBScript so that it reads the parameter as a
property of the installation (through the Session object) instead of
passing it as a command line argument you could use my approach:

I included the script as binary resource:

    <Binary
        Id='some_binary_id'
        src='script.vbs'
    />

I defined the custom action:

    <CustomAction
       Id='some_custom_action_id'
        BinaryKey='some_binary_id'
        VBScriptCall='Main'
    />

I set it to run before anything happens :D... obviously you should
change this to suit your needs:

*    <InstallExecuteSequence>
        <Custom
            Action='*some_custom_action_id*'
            After='CostFinalize'
        />
    </InstallExecuteSequence>
*
In the VBScript file I set the property INSTALLDIR like this:

    Session.TargetPath("INSTALLDIR") = path

Maybe you could get the property by reading instead of writing:

    font_path = Session.Property("SOMEPROPERTYDEFINEDINWIX")

Though if the font path is some path set as an installation path, than
you should get the property through the TargetPath and not Property (but
I am not sure, this is just an idea):

    font_path = Session.TargetPath("SOMEPROPERTYDEFINEDINWIX")

The details of defineing the property depend on where do you set the
value of the fonts folder. Is it some directory that the user chooses;
is it a directory hard coded?

Hope this helps :D

-- 
Szentpáli János


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to