I found the problem. I had to expand my properties (session.Format(string)) 
during my immediate CA, so that the deferred CA gets the actual path values, 
not the path 'tokens'.

Adam Langley

 Please consider the environment before printing this email!

-----Original Message-----
From: Adam Langley [mailto:alang...@winscribe.com] 
Sent: Thursday, 6 May 2010 3:35 p.m.
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] managed custom action cannot access target directory

I have written a deferred CA which I need to manipulate a file that is placed 
in the target-directory, at the end of the install.

What is weird is that the path is correctly evaluated in my logging messages, 
but when I use the path to open a file, it says FILE NOT FOUND, even though I 
KNOW the file is there.
I put in some extra logging, to enumerate the contents of the folder to prove 
that the file DOES exist, and I got this surprising result:

CustomActionData: 
      APPCONFIGPATH = C:\Program Files\Company\Client\Client.Windows.exe.config
      SECTIONTOENCRYPT = secureAppSettings
Attempting to load 'C:\Program Files\Company\Client\Client.Windows.exe.config', 
to encrypt section 'secureAppSettings'.
Configuration file 'C:\Program Files\Company\Client\Client.Windows.exe.config' 
was not found, have you scheduled the CA to execute after files are installed?
Enumerating files in 
'C:\Windows\assembly\GAC_MSIL\Microsoft.Deployment.WindowsInstaller\3.0.0.0__ce35f76fcda82bad'...
      - Microsoft.Deployment.WindowsInstaller.dll

As you can see, I am enumerating my target folder, but as soon as I start 
operating on the filesystem (such as Directory.GetFiles()), the .net runtime 
resolves all my queries to the GAC path where 
Microsoft.Deployment.WindowsInstaller.dll lives!!!
What is up with that? Why am I being sandboxed like this??


------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to