The problem is that the custom action needs to be run with elevated privileges,
which is what you
get when you open a command prompt as Administrator. You need [EMAIL
PROTECTED]"elevated".
The custom action will also need to be a deferred action.
Rob
Akshat Sharma wrote:
> Hi All,
>
> I am logged in as an administrative user in windows vista and I have a
> custom action (which calls a VB script function) in my .wxs file which
> creates a firewall exception.
> If I run the created .msi normally (just double clicking on it), the
> installation goes to completion but my firewall exception is not made. If I
> run the command prompt as Administrator and then run the .msi thru it ,the
> firewall exception gets created. I cannot understand the reason for this.
>
> I even have a condition which checks whether I am an admin or not and will
> ensures that the installation runs only if I am an admin. The installation
> does run and does not flag any error (meaning I am the admin) but the
> firewall exception is not created.
>
> Where am I going wrong ??
>
> My .wxs file looks like this :
>
> .
> .
> .
> <Condition Message="You need to be an administrator to install this product.">
> Privileged
> </Condition>
> .
> .
> .
> <InstallExecuteSequence>
> <Custom Action="FireWall" Sequence='1'/>
> </InstallExecuteSequence>
>
> <Binary Id='b.vbs' src='b.vbs'/>
> <CustomAction Id='FireWall' BinaryKey='b.vbs'
> VBScriptCall='FirewallEntry' Return='check'/>
> .
> .
> .
> .
>
> My script file b.vbs is :
>
> Function FireWallEntry
>
> Set objFirewall = CreateObject("HNetCfg.FwMgr")
> Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
>
> Set objApplication = CreateObject("HNetCfg.FwAuthorizedApplication")
> objApplication.Name = "Fence aks Manager"
> objApplication.IPVersion = 2
> objApplication.ProcessImageFileName = "<PATH to my PROGRAM>"
> objApplication.RemoteAddresses = "*"
> objApplication.Scope = 0
> objApplication.Enabled = True
>
> Set colApplications = objPolicy.AuthorizedApplications
> colApplications.Add(objApplication)
>
>
>
> -Regards,
> Akshat
> end Function
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users