Windows 8 search keeps showing my app name in lowercase - windows-8

I've created an desktop app for Windows and a corresponding WiX installer. Let's assume my app is called "Foo". The main executable and all app references are called "Foo", with caital "F".
But Windows 8 search (the one which pops up when you enter the Start screen and begin typing) only finds the reference to my app when I type it with "f" in lowercase and shows my app name with lowercase "f" in the beginning.
Here's how I register the Start screen reference in WiX:
<RegistryValue Root="HKLM" Key="SOFTWARE\RegisteredApplications" Name="Foo" Value="SOFTWARE\Foo\Capabilities" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Foo.exe" Value="[!Foo.exe]" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Foo.exe" Name="Path" Value="[APPLICATIONFOLDER]" Type="string" />
Is there a way to tell the Windows indexing service how should it index a particular executable?

To achieve what you are asking, I would add a shortcut to the windows 8 start menu search by creating a Shortcut element. You would tie that in to a Directory element, see general example below:
<Feature Id="StartMenuShortcut" >
<Component Id="StartMenuShortcut" Guid="SOME-GUID-HERE" Directory="ApplicationProgramsFolder" >
<Shortcut Id="ApplicationStartMenuShortcut"
Name="Foo"
Target="[INSTALLFOLDER]\foo.exe"
WorkingDirectory="INSTALLFOLDER"
Icon="SomeIconFileHereIfYouHaveOne.ico"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKLM" Key="Software\Microsoft\MyApplicationName" Name="installed" Type="integer" Value="1"
KeyPath="yes"/>
</Component>
</Feature>
Not only will this give you the start menu display name you desire for Foo.exe, but if Foo is ever uninstalled, this shortcut will be removed with it.
Hope this helps.

Related

Changing registry entry set by WiX

I'm new to WiX. I need to change the following registry-setting element:
<Component Id="BrowserEmulation" Directory="ApplicationProgramsFolder" Guid="*">
<RegistryValue Root="HKCU" Key="Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" Name="MY_REG_ENTRY" Value="11000" Type="integer" KeyPath="yes"/>
</Component>
So that the registry entry gets installed under HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER. I tried changing the Root value and the Key value:
<Component Id="BrowserEmulation" Directory="ApplicationProgramsFolder" Guid="*">
<RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" Name="MY_REG_ENTRY" Value="11000" Type="integer" KeyPath="yes"/>
</Component>
I also tried removing the KeyPath component. But when I try to build the .msi I get the following error:
error LGHT0204: ICE38: Component Browser Emulation installs to user
profile. It's KeyPath registry key must fall under HKCU
I looked at the WiX docs that describe Component KeyPaths but wasn't able to figure out how to get around this.
Directory: Looks like you need to take out the Directory attribute from your component. Maybe try something like this:
<Component Feature="MainApplication">
<RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" Name="MY_REG_ENTRY" Value="11000" Type="integer" KeyPath="yes"/>
</Component>
Bitness: Also be aware of the issue with 32-bit and 64-bit registry hives in HKLM: HKLM\SOFTWARE\WOW6432Node etc... Please see this answer for more details. I have inlined the most important part:
Registry:
64-Bit: HKEY_LOCAL_MACHINE\SOFTWARE
32-Bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
64-Bit: Maybe what you need is to mark your component as a 64-bit component? In order to write under HKEY_LOCAL_MACHINE\SOFTWARE?:
<Component Feature="MainApplication" Win64="yes">
<RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION" Name="MY_REG_ENTRY" Value="11000" Type="integer" KeyPath="yes"/>
</Component>

WiX Installer removes shortcut on upgrade

I am using the WiX Toolkit v3.11 for creating setups of my software. During installation I create startmenu shortcuts with the following code:
<Shortcut Id='startmenuMyProgram'
Name='$(var.MyProgramName)'
Directory='ProgramMenuFolder'
WorkingDirectory='APPLICATIONFOLDER'
Advertise='yes'
Icon='icon.exe'>
<Icon Id='icon.exe' SourceFile='$(var.Setuppath)\MyProgram.exe'/>
</Shortcut>
In this way I also create two shortcuts for other executables. Now for the uninstall I want to remove the shortcuts.
<Component Id="removeStartmenuShortcuts" Guid="803ad14a-feab-4901-b9db-2c4a1298ae8b">
<Condition>(REMOVE=ALL) AND NOT (WIX_UPGRADE_DETECTED OR UPGRADINGPRODUCTCODE)</Condition>
<RemoveFile Id="remove_startmenuProgram1" Name="startmenuMyProgram" On="uninstall" />
<RemoveFile Id="remove_startmenuProgram2" Name="startmenuMyProgram2" On="uninstall"/>
<RemoveFile Id="remove_startmenuProgram3" Name="startmenuMyProgram3" On="uninstall"/>
</Component>
This works without any problems when I uninstall the software. But the shortcuts are also removed when an update is performed. But I want to prevent this behavior, but the condition seems not to work. So all shortcuts like in the Windows task bar are removed when I do an update.
How can I make my update progress work correctly?
Here the behavior after update:
The group with all shortcuts in the right is missing!
You can combine the 2 component. By this you will not need to use condition statements.
The registry value is to set a keypath under component.
<Component Id="cmpstartmenuMyProgram" Guid="{67CB4F7A-5028-4697-A47F-DE99110B9645}">
<Shortcut Id="Shortcut.ApplicationName"
Name="ApplicationName"
Target="[INSTALLDIR]ApplicationName.exe"
WorkingDirectory="INSTALLDIR"
Directory="StartMenuFolder"
Icon="Icon.exe"/>
<RemoveFile Id="RemoveStartMenuShortcut.ApplicationName" Name="ApplicationName" Directory="StartMenuFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Compony\ComponyName" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>

Windows Installer not deleting all files on uninstall

I've seen some similar questions asked on here, but none of the solutions given were very clear or worked for me.
I have an installer (created with WiX) which installs certain files and folders. However, when running the installed application, this creates some folders and copies some files into it. These files and folders are not removed on uninstall.
Edited to Show Code so Far:
This INSTALLDIR property:
<Property Id="INSTALLDIR">
<RegistrySearch Id='Registry' Type='raw' Root='HKLM' Key='Software\$(var.Manufacturer)\$(var.ProductName)' Name='Location' />
</Property>
This Component which should set the install location in the registry:
<Component Id="Registry" Guid="*">
<RegistryKey Root="HKMU" Key="Software\$(var.Manufacturer)\$(var.ProductName)">
<RegistryValue Name="Location"
Type="string"
Value="[INSTALLDIR]"
Action="write"
KeyPath="yes" />
</RegistryKey>
<util:RemoveFolderEx On="uninstall" Property="INSTALLDIR" />
</Component>
This does create a record in the registry with the install location, but I'm not sure how to adapt this code to making note of the 'public' directory and removing it - I don't know where the util:RemoveFolderEx should go either (inside which component)
The clearest tutorial I've seen is this one (except that it does have an apparent error).
Replace this block:
<!--
RemoveFolderEx requires that we "remember" the path for uninstall.
Read the path value and set the APPLICATIONFOLDER property with the value.
-->
<Property Id="APPLICATIONFOLDER">
<RegistrySearch Key="SOFTWARE\$(var.Manufacturer)\$(var.SkuName)" Root="HKLM" Type="raw" Id="APPLICATIONFOLDER_REGSEARCH" Name="Path" />
</Property>
with this one:
<!--
RemoveFolderEx requires that we "remember" the path for uninstall.
Read the path value and set the FOLDERTOREMOVE property with the value.
-->
<Property Id="FOLDERTOREMOVE">
<RegistrySearch Key="SOFTWARE\$(var.Manufacturer)\$(var.SkuName)" Root="HKLM" Type="raw" Id="APPLICATIONFOLDER_REGSEARCH" Name="Path" />
</Property>
and this block:
<util:RemoveFolderEx On="uninstall" Property="APPLICATIONFOLDER" />
with this one:
<util:RemoveFolderEx On="uninstall" Property="FOLDERTOREMOVE" />
and you should have a working test.
The reason for using two different properties is given here and here (among with other places).
If you can derive the path from other values you may have set during installation that Windows Installer will preserve for you, such as ARPINSTALLLOCATION, then you can adjust the above implementation to get what you need without having to create your own registry keys.
Builds on B. Murri's answer:
Example: your application installs new files or folders in 'installdir/public'. These files aren't being deleted as they weren't added by the installer.
First, you need to create a registry value which will store where your public directory is installed. This is in case the user changes the install directory.
<!-- Note that the RegistryValue Value is being set to the 'public' directory ID -->
<DirectoryRef Id='INSTALLDIR'>
<Component Id="RemovePublicDir" Guid="your-guid-here">
<RegistryKey Root="HKCU" Key="Software\$(var.Manufacturer)\$(var.ProductName)">
<RegistryValue Name="Location"
Type="string"
Value="[PUBLIC]"
Action="write"
KeyPath="yes" />
</RegistryKey>
<CreateFolder Directory="PUBLIC"/>
<util:RemoveFolderEx Property="FINDPUBLICDIR" On="uninstall"/>
<RemoveFolder Id="PUBLIC" On="uninstall"/>
</Component>
</DirectoryRef>
You now need to add a property which will search for this registry value later on. Make sure your Root value above matches the one below:
<Property Id="FINDPUBLICDIR">
<RegistrySearch Id='Registry' Type='raw' Root='HKCU' Key='Software\$(var.Manufacturer)\$(var.ProductName)' Name='Location' />
</Property>
Add your manufacturer name and product name to variables, like this:
<?define Manufacturer = "My Company"?>
<?define ProductName = "Test Application"?>
Now make sure you call this Component in your Feature tag:
<Feature Id="FeatureId">
<ComponentRef Id="RemovePublicDir" />
</Feature>

WIX- support multiple Instance of Web App on IIS

I am using wix to create my msi installer. the installer will create a new app pool and virtual directory in the IIS to run my web app.
Right now, I am trying to have multiple instance of the web app on the same machine at the same time(either same version, or higher version).
-Is such thing supported in Wix?
-Can I dynamically create multiple app pool and virtual directory on each installation? Because at the moment the name of the appPool, and Virtual directory and destination folder are hard coded inside the Product.WXS file.
I think that you can't even perform setup multiple times, it will just try to uninstall, modify or repair your previous installation or to perform upgrade.
But regarding app pool or website name you can specify it in installation process in your feature selection dialog, to have textbox where you can write down name of website or app pool
<Control Id="WebsiteName" Type="Text" X="..." Y="..." Width="..." Height="..." Text="Website name :" Indirect="no" >
<Condition Action="hide">Installed</Condition>
</Control>
<Control Id="WebsiteName" Type="Edit" X="..." Y="..." Width="..." Height="..." Property="WEBSITENAME" Text="{50}" Indirect="no" >
<Condition Action="hide">Installed</Condition>
</Control>
Than you need to specify your property at Product.wxs
<Property Id="WEBSITENAME" Value="YourDefaultWebSiteName" Secure="yes">
<RegistrySearch Id="FindWebSiteName" Root="HKCU"
Key="SOFTWARE\YourCompany\YourProduct"
Name="WebsiteName" Type="raw"/>
</Property>
<Property Id="APPPOOL" Value="0" Secure="yes">
<RegistrySearch Id="FindWixSetupInstallation" Root="HKCU"
Key="SOFTWARE\YourCompany\YourProduct"
Name="webAppPool" Type="raw"/>
</Property>
Than you need to specify it at your settings where you create app pool and website name
<iis:WebSite Id="DefaultWebSite" Description="Default Web Site">
<iis:WebAddress Id="AllUnassigned" Port="80" />
</iis:WebSite>
<DirectoryRef Id="YourDirectory" >
<Component Id="CMP_CONFIG" Guid="{YOURGUID}" KeyPath="yes">
<iis:WebVirtualDir Id="WebsiteName" Alias="[WEBSITENAME]" Directory="YourDirectory" WebSite="DefaultWebSite">
<iis:WebApplication Id="YourApplicationApp" Name="[WEBSITENAME]" WebAppPool="[WEBSITENAME]" />
<iis:WebDirProperties Id="YourApplicationDirProp" Script="yes" Execute="yes" Read ="yes" DefaultDocuments="Default.aspx"/>
</iis:WebVirtualDir>
</Component>
</DirectoryRef>
And if you want to create shortcut to desktop
<DirectoryRef Id="DesktopFolder">
<Component Id="YourWebsiteAppDesktopShortcut" Guid="{YOURGUID}">
<RegistryValue Root="HKCU"
Key="SOFTWARE\YourCompany\YourProduct"
Name="YourWebsiteApp"
Type="integer"
Value="1"
KeyPath="yes"/>
<util:InternetShortcut Id="WebSiteDesktopShortcut"
Directory="DesktopFolder"
Name="YourWebsiteAppName"
Target="http://localhost/[WEBSITENAME]/"
Type="url" />
</Component>
</DirectoryRef>
And you just need to register all those component reference ID's in your Product.wxs

Wix shortcut desktop - is this code for current user or all users

I am trying to create a shortcut for all users using Wix 3.6. My InstallScope is perMachine and InstallPriviledges is elevated. I build this code ok. It runs ok. Does this produce a shortcut for all users or just the current user and what do I need to change to make a shortcut for all users?
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationDesktopShortcut" Guid="*">
<Shortcut Id="MyClient_DesktopShortcut" Name="My Client"
Description="My Client" Target="[INSTALLFOLDER]MyClient.exe"
WokingDirectory="INSTALLFOLDER" />
<RegistryValue Root="HKCU" Key="Software\MyServices\My Client\DesktopShortcut"
Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
Thanks
Jason