Yeah I do that in my installer too. You shouldn't need to write your own
custom action for that.  I use XmlFile, but you can also use XmlConfig I
believe.

-----Original Message-----
From: Steve Oliver [mailto:ste...@one-slip.com] 
Sent: Tuesday, December 16, 2008 4:06 PM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Problem with Custom Action

I am trying to update an xml file with information that is input by the
user. My custom action displays a dialog to collect the information.

-----Original Message-----
From: Scott Sam [mailto:s...@clearviewecm.com] 
Sent: Tuesday, December 16, 2008 1:49 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Problem with Custom Action

Sorry I forgot you lose access to the session in the deferred script.
I'm not really clear on what you are trying to accomplish with the
second CA.  Are you trying to update a value in an appconfig file with
the value of [INSTALLDIR]?  If so I would suggest using the XmlFile or
XmlConfig elements in wix. 

-----Original Message-----
From: Steve Oliver [mailto:ste...@one-slip.com] 
Sent: Tuesday, December 16, 2008 3:32 PM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Problem with Custom Action

I tried running deferred. Here is the result

Exception thrown by custom action:
System.Reflection.TargetInvocationException: Exception has been thrown
by
the target of an invocation. --->
Microsoft.Deployment.WindowsInstaller.InvalidHandleException: The handle
is
invalid.
   at Microsoft.Deployment.WindowsInstaller.Session.GetTargetPath(String
directory)
   at
WhiteNoise.SecureNOW.CustomAction.CustomActions.ConfigureStorage(Session
session)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object
arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object
arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags
invokeAttr, Binder binder, Object parameters, CultureInfo culture,
Boolean
skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags
invokeAttr, Binder binder, Object parameters, CultureInfo culture)
   at
Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomActi
on(I
nt32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)

-----Original Message-----
From: Scott Sam [mailto:s...@clearviewecm.com] 
Sent: Tuesday, December 16, 2008 1:00 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Problem with Custom Action

Are you custom actions executing deferred?  No changes are made to the
system until the deferred mode. So the files won't be installed on the
system until the deferred sequence.

-----Original Message-----
From: Steve Oliver [mailto:ste...@one-slip.com] 
Sent: Tuesday, December 16, 2008 2:46 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Problem with Custom Action

I am writing a couple of managed custom actions. In the first action I
need
to access an assembly that is installed to the GAC via a merge file as
part
of the install. The problem is that the assembly does not seem to be
available until the installer has completed.

 

    <InstallExecuteSequence>

      <Custom Action="CAConfigureTecSecEnv" After="InstallFinalize">Not
REMOVE</Custom>

      <Custom Action="CAConfigureStorage" After="InstallFiles">Not
REMOVE</Custom>

    </InstallExecuteSequence>

 

Before the method in the custom action executes I get the error, "Could
not
load file or assembly.". After the install completes I can see that the
assembly has been successfully installed but can't access while the
installer is running. 

 

In the second action I'm trying to read a configuration file that is
installed as part of the installation and modify it and write it back to
the
install directory. I locate the file using.

 

   string pathAppConfig =
Path.Combine(session.GetTargetPath("INSTALLDIR"),
Util.Constants.APP_CONFIG);

 

which gives the path I'm expecting to see. The same kind of problem
occurs
as in the first. I get a "File not found." error. I've made the
assumption
that sequencing the action to run After InstallFiles means that all
files
have been installed to the target directory  and are available. It looks
like that is not the case. So my question is this,

 

When do files and/or assemblies that are being installed become
available to
be used in a custom action?  

 

Thanks for the assistance.

 

Steve

   

------------------------------------------------------------------------
------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
The future of the web can't happen without you.  Join us at MIX09 to
help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.
com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------
----
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
The future of the web can't happen without you.  Join us at MIX09 to
help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.
com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------
------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
The future of the web can't happen without you.  Join us at MIX09 to
help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.
com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------
----
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
The future of the web can't happen without you.  Join us at MIX09 to
help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.
com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------
------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
Nevada.
The future of the web can't happen without you.  Join us at MIX09 to
help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.
com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to