Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-09 Thread wixtester
Thank you all for suggestions! Truly appreciate all the help.





--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-built-for-AnyCPU-does-not-read-64-bit-registry-hive-tp7598754p7598793.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-08 Thread wixtester

I may have not been clear in my earlier emails, sorry about that. 
I have a C# custom action that uses Microsoft.Win32.RegistryKey. I am
building this custom action with AnyCPU. The custom action searches for JRE
on the system and set a value to Session variable. I have 64-bit JRE
installed on the machine. 
When the installer runs, it doesn't seem to search the 64-bit registry when
run on 64-bit Operating system, which is quite confusing. My understanding
is that the msiexec process that runs the custom action will be 64-bit in
this case and will launch the CA as 64-bit too.
I also confirmed with Corflags that the customAction was built correctly. 

I don't think marking the custom action as 'Defer' matters here.



Custom Action definition

Binary Id=provisionCA
SourceFile=$(var.ProvCustomAction.TargetDir)Provision.CA.dll /
CustomAction Id='customActioncheckJavaHomeEnvVar'
BinaryKey='provisionCA' DllEntry='SearchJRE' Execute=immediate
Return=check/





Snippet from custom action
---

session.Log(Begin SearchJRE);

RegistryKey root = Registry.LocalMachine;
string path = @Software\Javasoft\Java Runtime Environment;

using (RegistryKey jreRoot = root.OpenSubKey(path))
{
if (jreRoot == null)
{
session.Log(Java is not installed. JRE entry not found
in registry at  + path);
session[JAVA_HOME_PATH] = 0;
return ActionResult.Success;
}
   . 
   . AND MUCH MORE


Thanks!






--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-built-for-AnyCPU-does-not-read-64-bit-registry-hive-tp7598754p7598766.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-08 Thread Daniel Norman
Hi,

I had to create two separate binaries for this, in a similar case. One built 
for x64, the other x86 - then I trigger the appropriate one depending on the OS 
architecture.
The issue is that C# Registry.LocalMachine will run against the Wow6432Node in 
the registry, if the binary is 32-bit. This was my way of how to easiest 
resolve it, but if you figure out some other way, feel free to let us know :)

Kind regards,

Daniel Norman
Support Specialist

-Original Message-
From: wixtester [mailto:sangee...@hotmail.com] 
Sent: den 8 januari 2015 13:27
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit 
registry hive


I may have not been clear in my earlier emails, sorry about that. 
I have a C# custom action that uses Microsoft.Win32.RegistryKey. I am building 
this custom action with AnyCPU. The custom action searches for JRE on the 
system and set a value to Session variable. I have 64-bit JRE installed on the 
machine. 
When the installer runs, it doesn't seem to search the 64-bit registry when run 
on 64-bit Operating system, which is quite confusing. My understanding is that 
the msiexec process that runs the custom action will be 64-bit in this case and 
will launch the CA as 64-bit too.
I also confirmed with Corflags that the customAction was built correctly. 

I don't think marking the custom action as 'Defer' matters here.



Custom Action definition

Binary Id=provisionCA
SourceFile=$(var.ProvCustomAction.TargetDir)Provision.CA.dll /
CustomAction Id='customActioncheckJavaHomeEnvVar'
BinaryKey='provisionCA' DllEntry='SearchJRE' Execute=immediate
Return=check/





Snippet from custom action
---

session.Log(Begin SearchJRE);

RegistryKey root = Registry.LocalMachine;
string path = @Software\Javasoft\Java Runtime Environment;

using (RegistryKey jreRoot = root.OpenSubKey(path))
{
if (jreRoot == null)
{
session.Log(Java is not installed. JRE entry not found in 
registry at  + path);
session[JAVA_HOME_PATH] = 0;
return ActionResult.Success;
}
   . 
   . AND MUCH MORE


Thanks!






--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-built-for-AnyCPU-does-not-read-64-bit-registry-hive-tp7598754p7598766.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Dive into the World of Parallel Programming! The Go Parallel Website, sponsored 
by Intel and developed in partnership with Slashdot Media, is your hub for all 
things parallel software development, from weekly thought leadership blogs to 
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net 
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-08 Thread John Cooper
This is also necessary when accessing x64 areas of the file system.  I have 
64-bit versions of some of my custom actions when this is necessary.

--
John Merryweather Cooper
Senior Software Engineer | Enterprise Service Applications | Continuing 
Development
Jack Henry  Associates, Inc.® | Lenexa, KS  66214 | Ext:  431050 
|jocoo...@jackhenry.com



-Original Message-
From: Daniel Norman [mailto:daniel.nor...@snowsoftware.com] 
Sent: Thursday, January 8, 2015 6:55 AM
To: General discussion about the WiX toolset.
Subject: Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit 
registry hive

Hi,

I had to create two separate binaries for this, in a similar case. One built 
for x64, the other x86 - then I trigger the appropriate one depending on the OS 
architecture.
The issue is that C# Registry.LocalMachine will run against the Wow6432Node in 
the registry, if the binary is 32-bit. This was my way of how to easiest 
resolve it, but if you figure out some other way, feel free to let us know :)

Kind regards,

Daniel Norman
Support Specialist

-Original Message-
From: wixtester [mailto:sangee...@hotmail.com] 
Sent: den 8 januari 2015 13:27
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit 
registry hive


I may have not been clear in my earlier emails, sorry about that. 
I have a C# custom action that uses Microsoft.Win32.RegistryKey. I am building 
this custom action with AnyCPU. The custom action searches for JRE on the 
system and set a value to Session variable. I have 64-bit JRE installed on the 
machine. 
When the installer runs, it doesn't seem to search the 64-bit registry when run 
on 64-bit Operating system, which is quite confusing. My understanding is that 
the msiexec process that runs the custom action will be 64-bit in this case and 
will launch the CA as 64-bit too.
I also confirmed with Corflags that the customAction was built correctly. 

I don't think marking the custom action as 'Defer' matters here.



Custom Action definition

Binary Id=provisionCA
SourceFile=$(var.ProvCustomAction.TargetDir)Provision.CA.dll /
CustomAction Id='customActioncheckJavaHomeEnvVar'
BinaryKey='provisionCA' DllEntry='SearchJRE' Execute=immediate
Return=check/





Snippet from custom action
---

session.Log(Begin SearchJRE);

RegistryKey root = Registry.LocalMachine;
string path = @Software\Javasoft\Java Runtime Environment;

using (RegistryKey jreRoot = root.OpenSubKey(path))
{
if (jreRoot == null)
{
session.Log(Java is not installed. JRE entry not found in 
registry at  + path);
session[JAVA_HOME_PATH] = 0;
return ActionResult.Success;
}
   . 
   . AND MUCH MORE


Thanks!






--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-built-for-AnyCPU-does-not-read-64-bit-registry-hive-tp7598754p7598766.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Dive into the World of Parallel Programming! The Go Parallel Website, sponsored 
by Intel and developed in partnership with Slashdot Media, is your hub for all 
things parallel software development, from weekly thought leadership blogs to 
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net 
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are 
intended
exclusively for the individual or entity to which it is addressed. The message, 
together with any attachment, may contain confidential and/or privileged 
information.
Any unauthorized review, use, printing, saving, copying, disclosure or 
distribution 
is strictly prohibited. If you have received this message in error, please 
immediately advise the sender by reply email and delete all copies.


--
Dive

Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-08 Thread Phill Hogland
Regarding the comments about using AnyCPU this blog explains one reason why
on a x64 system AnyCPU runs a 32 bit instance of .Net
http://blogs.microsoft.co.il/sasha/2012/04/04/what-anycpu-really-means-as-of-net-45-and-visual-studio-11/




--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-built-for-AnyCPU-does-not-read-64-bit-registry-hive-tp7598754p7598769.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-08 Thread Phil Wilson
You should be building separate MSIs for both arcitectures:

http://blogs.msdn.com/b/heaths/archive/2008/01/15/different-packages-are-required-for-different-processor-architectures.aspx

so build an x86 Dll for 32-bit systems and an x64 Dll for 64-bit.

In any case, AnyCpu for a Dll actually means run with the bitness of
the caller. and in a 32-bit setup the most likely reason for what
you're seeing is that the 32-bit setup is propagating its 32-bit state
into the custom action process that calls your Dll.
---
Phil Wilson


On Thu, Jan 8, 2015 at 6:39 AM, Phill Hogland phogl...@rimage.com wrote:
 Regarding the comments about using AnyCPU this blog explains one reason why
 on a x64 system AnyCPU runs a 32 bit instance of .Net
 http://blogs.microsoft.co.il/sasha/2012/04/04/what-anycpu-really-means-as-of-net-45-and-visual-studio-11/




 --
 View this message in context: 
 http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-built-for-AnyCPU-does-not-read-64-bit-registry-hive-tp7598754p7598769.html
 Sent from the wix-users mailing list archive at Nabble.com.

 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 WiX-users mailing list
 WiX-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wix-users

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-08 Thread Rob Mensching
My bad, I always forget that. For binaries, the Windows Installer peeks at the 
executable binary and figures out how to host it. Any CPU managed code 
assemblies a 'architecture preference' (default is x86, IIRC). You can change 
that preference at build time, IIRC.

_
 Short replies here. Complete answers over there: http://www.firegiant.com/


-Original Message-
From: wixtester [mailto:sangee...@hotmail.com] 
Sent: Wednesday, January 7, 2015 6:49 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit 
registry hive


The CustomAction does not permit Win64 attribute for a managed custom action

CustomAction Id='customActioncheckJavaHomeEnvVar'
BinaryKey='provisionCA' DllEntry='SearchJRE' Execute=immediate
Return=check Win64=yes/


Error message

 error CNDL0037: The CustomAction/@Win64 attribute can only be specified with 
one of the following attributes:Script, VBScriptCall, or JScriptCall present. 


Note: I am using managed custom action because of some additional processing 
required, after the JRE version is identified. 

Thanks much!


--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-07 Thread wixtester

The CustomAction does not permit Win64 attribute for a managed custom
action

CustomAction Id='customActioncheckJavaHomeEnvVar'
BinaryKey='provisionCA' DllEntry='SearchJRE' Execute=immediate
Return=check Win64=yes/


Error message

 error CNDL0037: The CustomAction/@Win64 attribute can only be specified
with one of the following attributes:Script, VBScriptCall, or JScriptCall
present. 


Note: I am using managed custom action because of some additional processing
required, after the JRE version is identified. 

Thanks much!





--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-built-for-AnyCPU-does-not-read-64-bit-registry-hive-tp7598754p7598761.html
Sent from the wix-users mailing list archive at Nabble.com.

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-07 Thread Jeremiahf
Defer it?

On Wed, Jan 7, 2015 at 8:49 PM, wixtester sangee...@hotmail.com wrote:


 The CustomAction does not permit Win64 attribute for a managed custom
 action

 CustomAction Id='customActioncheckJavaHomeEnvVar'
 BinaryKey='provisionCA' DllEntry='SearchJRE' Execute=immediate
 Return=check Win64=yes/


 Error message
 
  error CNDL0037: The CustomAction/@Win64 attribute can only be specified
 with one of the following attributes:Script, VBScriptCall, or JScriptCall
 present.


 Note: I am using managed custom action because of some additional
 processing
 required, after the JRE version is identified.

 Thanks much!





 --
 View this message in context:
 http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-built-for-AnyCPU-does-not-read-64-bit-registry-hive-tp7598754p7598761.html
 Sent from the wix-users mailing list archive at Nabble.com.


 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 WiX-users mailing list
 WiX-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wix-users




-- 
They may forget what you said but they will never forget how you made them
feel. -- Anonymous
--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-07 Thread Jeremiahf
Sorry, for the short response. I have done it by setting conditions. x86 vs
x64.Per Rob's blog, check this out
http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/block_install_on_os.html
and (it is also linked) http://msdn.microsoft.com/library/aa370556.aspx

It should give you some direction.

On Thu, Jan 8, 2015 at 12:01 AM, Jeremiahf jeremi...@gmail.com wrote:

 Defer it?

 On Wed, Jan 7, 2015 at 8:49 PM, wixtester sangee...@hotmail.com wrote:


 The CustomAction does not permit Win64 attribute for a managed custom
 action

 CustomAction Id='customActioncheckJavaHomeEnvVar'
 BinaryKey='provisionCA' DllEntry='SearchJRE' Execute=immediate
 Return=check Win64=yes/


 Error message
 
  error CNDL0037: The CustomAction/@Win64 attribute can only be specified
 with one of the following attributes:Script, VBScriptCall, or JScriptCall
 present.


 Note: I am using managed custom action because of some additional
 processing
 required, after the JRE version is identified.

 Thanks much!





 --
 View this message in context:
 http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/CustomAction-built-for-AnyCPU-does-not-read-64-bit-registry-hive-tp7598754p7598761.html
 Sent from the wix-users mailing list archive at Nabble.com.


 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 WiX-users mailing list
 WiX-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wix-users




 --
 They may forget what you said but they will never forget how you made
 them feel. -- Anonymous




-- 
They may forget what you said but they will never forget how you made them
feel. -- Anonymous
--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] CustomAction built for AnyCPU does not read 64-bit registry hive

2015-01-07 Thread Rob Mensching
See the CustomAction/@Win64 attribute.

___
 FireGiant  |  Dedicated support for the WiX toolset  |  
http://www.firegiant.com/


-Original Message-
From: wixtester [mailto:sangee...@hotmail.com] 
Sent: Wednesday, January 7, 2015 12:55 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] CustomAction built for AnyCPU does not read 64-bit 
registry hive

Hi,

   I have a managed custom action to read the registry. I want it to read the 
64-bit registry on a 64-bit Windows and 32-bit registry on x86 Windows.
When I build the custom action for AnyCPU, I expect it to work. 
But when I run the msi  (that invokes this custom action) on Win 2008 R2 which 
is 64-bit, the custom action did not read the 64-bit registry.
Can someone correct me here as to why the installer custom action goes for 
32-bit registry search?

thanks!

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users