Not to create key under HKCU path in the registry

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Not to create key under HKCU path in the registry

manoj Rawat
Hi,

My requirement is, not to create a key under HKCU path by WIX installer.
Can you please let me know how to avoid default path(HKCU) in the registry?

*<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]"
Name="installed" Type="integer" Value="1" KeyPath="yes"/>*

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="TestWindowService" Language="1033" Version="1.0.0.0"
Manufacturer="Test Service"
UpgradeCode="8cfc33c6-292f-4bad-a488-4781ae709c5e">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is
already installed." />
<MediaTemplate EmbedCab="yes" />

<Feature Id="ProductFeature" Title="TestWindowService" Level="1">
<ComponentGroupRef Id="ProductComponents" />
      <ComponentGroupRef Id="TestWindowServiceShortcut" />
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
        <Directory Id="ManufacturerFolder"
Name="!(bind.property.Manufacturer)">
<Directory Id="INSTALLFOLDER" Name="!(bind.property.ProductName)" />
        </Directory>
</Directory>
      <!-- Step 1: Define the directory structure -->
      <Directory Id="ProgramMenuFolder">
        <Directory Id="ApplicationProgramsFolder" Name="TestWindowService"/>
      </Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the
ComponentRef below in order to add resources to this installer. -->
 <Component Id="ProductComponent">
<!-- TODO: Insert files, registry keys, and other resources here. -->
         <File Id="TestWindowService"
Source="$(var.TestWindowsService.TargetPath)" KeyPath="yes"/>
         <ServiceInstall Id="TestWindowService"
DisplayName="TestWindowService" Name="TestWindowService" Description="Test
window service" Account="LocalSystem" ErrorControl="normal" Start="demand"
Type="ownProcess" Vital="yes" />
         <ServiceControl Id="ControlWixService"
Name="TestWindowService.exe" Stop="uninstall" Remove="uninstall" />
       </Component>
</ComponentGroup>
    <ComponentGroup Id="TestWindowServiceShortcut"
Directory="ApplicationProgramsFolder">
      <Component Id="TestWindowServiceShortcut"
Guid="01E98283-4246-46BC-A39F-0F1975C95AA6">
        <Shortcut Id="UninstallProduct" Name="Uninstall TestWindowService"
Description="Uninstalls TestWindowService Application"
Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]"/>
        *<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>*
*        <RegistryValue Root="HKCU"
Key="Software\[Manufacturer]\[ProductName]" Name="installed" Type="integer"
Value="1" KeyPath="yes"/>*
      </Component>
    </ComponentGroup>
</Fragment>
</Wix>

Thanks,
Manoj
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Not to create key under HKCU path in the registry

Nir Bar
Specify a different Root attribute?
Nir Bar
Freelance Developer
Mail: nir.bar@panel-sw.com
Web: www.panel-sw.com
- C++ On Windows, Linux and Embedded Platforms
- WiX & InstallShield
Reply | Threaded
Open this post in threaded view
|

Re: Not to create key under HKCU path in the registry

manoj Rawat
Hi Nir,

I changed root path to "HKLM" and got below errors.

ICE38: Component TestWindowServiceShortcut installs to user profile. It's
KeyPath registry key must fall under HKCU.
ICE43: Component TestWindowServiceShortcut has non-advertised shortcuts.
It's KeyPath registry key should fall under HKCU.
ICE57: Component 'TestWindowServiceShortcut' has both per-user and
per-machine data with a per-machine KeyPath.

Thanks,
Manoj


On Thu, Jun 25, 2015 at 1:43 AM, Nir Bar <[hidden email]> wrote:

> Specify a different Root attribute?
>
>
>
> -----
> Nir Bar
> Freelance Developer
> Mail: [hidden email]
> Web: www.panel-sw.com
>    - C++ On Windows, Linux and Embedded Platforms
>    - WiX & InstallShield
> --
> View this message in context:
> http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Not-to-create-key-under-HKCU-path-in-the-registry-tp7600703p7600711.html
> Sent from the wix-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Monitor 25 network devices or servers for free with OpManager!
> OpManager is web-based network management software that monitors
> network devices and physical & virtual servers, alerts via email & sms
> for fault. Monitor 25 devices for free with no restriction. Download now
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Not to create key under HKCU path in the registry

Rob Mensching-7
I think this applies: http://robmensching.com/blog/posts/2007/4/27/how-to-create-an-uninstall-shortcut-and-pass-all-the/

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


-----Original Message-----
From: Manoj Rawat [mailto:[hidden email]]
Sent: Thursday, June 25, 2015 1:27 AM
To: General discussion about the WiX toolset.; [hidden email]
Subject: Re: [WiX-users] Not to create key under HKCU path in the registry

Hi Nir,

I changed root path to "HKLM" and got below errors.

ICE38: Component TestWindowServiceShortcut installs to user profile. It's KeyPath registry key must fall under HKCU.
ICE43: Component TestWindowServiceShortcut has non-advertised shortcuts.
It's KeyPath registry key should fall under HKCU.
ICE57: Component 'TestWindowServiceShortcut' has both per-user and per-machine data with a per-machine KeyPath.

Thanks,
Manoj

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Not to create key under HKCU path in the registry

Namrata Kumari
In reply to this post by manoj Rawat
I an able to create registry entry using below :

    <Component Id="x64GuruKeys" Guid="9421AAE1-93E0-403E-8F9E-11CD648A2F3F" Win64="yes" Directory="GURUINSTALLATION">
      <RegistryKey Id="x64GuruRegKey" Root="HKLM" Key="SOFTWARE\Wow6432Node\Installed_PRD\$(var.ProductName)" Action="createAndRemoveOnUninstall">
        <RegistryValue Id="x64GuruRegValue" Name="Guru" Action="write" Value="[GURUINSTALLATION]" Type="string" />
      </RegistryKey>
    </Component>
Reply | Threaded
Open this post in threaded view
|

Re: Not to create key under HKCU path in the registry

manoj Rawat
Thanks Namrata,

I am just wondering if we can change the Registry path from HKCU to HKLM while creating shortcut of application.

<ComponentGroup Id="TestWindowServiceShortcut" Directory="ApplicationProgramsFolder">
      <Component Id="TestWindowServiceShortcut" Guid="01E98283-4246-46BC-A39F-0F1975C95AA6">
        <Shortcut Id="UninstallProduct" Name="Uninstall TestWindowService" Description="Uninstalls TestWindowService Application" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]"/>
        <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
        <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
      </Component>
    </ComponentGroup>