Add showing HTML page due WiX installation - installation

I have an issue with adding html show up in my WiX bundle. Have you any idea how to make it?

Second way how u can resolve it is by open default browser
<Property Id="BROWSER">
<RegistrySearch Id='DefaultBrowser' Type='raw' Root='HKCR' Key='http\shell\open\command' />
</Property>
<CustomAction Id="LaunchBrowser" Directory="INSTALLDIR" Impersonate="no" Execute="deferred"
ExeCommand='[BROWSER] "file://[InputResourcesDir]html.html"' Return="asyncNoWait"/>
<InstallExecuteSequence>
<Custom Action='LaunchBrowser' Before='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>
<Directory Id="InputResourcesDir" Name="resource">
<Component Id="index.html" Guid="{EE71FB84-2328-474E-9E5C-A29D2AD6EFD5}">
<File Id="filEE71FB842328474E9E5CA29D2AD6EFD5"
Source="$(var.project.path)/$(var.project.resourceDir)/index.html" />
</Component>
</Directory>
<Feature Id>
<ComponentRef Id="index.html"/>
</Feature>

First way i have resolved is using internal WiX dll WixShellExec
<Property Id="WixShellExecTarget" Value="[InputResourcesDir]index.html" />
<CustomAction Id="OpenHtmlPage" BinaryKey="WixCA" DllEntry="WixShellExec" />
<InstallExecuteSequence>
<Custom Action='OpenHtmlPage' After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>
<Directory Id="InputResourcesDir" Name="resource">
<Component Id="index.html" Guid="{EE71FB84-2328-474E-9E5C-A29D2AD6EFD5}">
<File Id="filEE71FB842328474E9E5CA29D2AD6EFD5"
Source="$(var.project.path)/$(var.project.resourceDir)/index.html" />
</Component>
</Directory>
<Feature Id>
<ComponentRef Id="index.html"/>
</Feature>
but this way has a problem, bcs html page is opened by default application (Notepad, Sublime, Chrome etc) that obviosly maybe will not be a browser.

Related

Wix - Only Install Package via Custom Action when a specific registry doesnt exist

I have tried for 10 hours million things but I don't get it to work. Here is my code (extract):
<Fragment>
<util:RegistrySearch Id="VC_REDIST_Version"
Root="HKCR"
Variable="VCREDIST143431931"
Key="Installer\Dependencies\VC,redist.x86,x86,14.34,bundle"
Format="raw"
Value="Version"
Result="value" />
<ComponentGroup Id="ThirdPartyComponents" Directory="ExtSources">
<Component Id="Component_VC_redist_x86" Guid="2B80F89A-990A-438E-A475-9E72d8A0198A" >
<File Id="ExtSources_VC_redist.x86.exe" Name="VC_redist.x86.exe" Source="$(var.xxxxx_TargetDir)ExtSources\VC_redist.x86.exe" />
</Component>
</ComponentGroup>
<CustomAction Id="Install_VC_redist_x86"
Execute="immediate"
Impersonate="no"
Return="asyncNoWait"
FileKey="ExtSources_VC_redist.x86.exe"
ExeCommand="" />
<InstallExecuteSequence>
<Custom Action="Install_VC_redist_x86" After="InstallFinalize">NOT VCREDIST143431931</Custom>
</InstallExecuteSequence>
</Fragment>
But the problem is that the Custom action is executed always, independent from the state.
Any Idea what might be wrong?
UPDATE:
This is now how I did it and it works including skipping calling the installer when there is already a newer or same version of vc distrib installed:
<Fragment>
<Property Id="VCREDISTINSTALLED">
<RegistrySearch Id="VCRedistInstalledSearch"
Root="HKCR"
Key="Installer\Dependencies\VC,redist.x86,x86,14.34,bundle"
Name="Version"
Type="raw"
Win64="no"/>
</Property>
<ComponentGroup Id="ThirdPartyComponents" Directory="ExtSources">
<Component Id="Component_VC_redist_x86" Guid="2B80F89A-990A-438E-A475-9E72d8A0198A" >
<File Id="ExtSources_VC_redist.x86.exe" Name="VC_redist.x86.exe" Source="$(var.xxxxx_TargetDir)ExtSources\VC_redist.x86.exe" />
</Component>
</ComponentGroup>
<CustomAction Id="Install_VC_redist_x86"
Execute="immediate"
Return="asyncNoWait"
FileKey="ExtSources_VC_redist.x86.exe"
ExeCommand="/quiet /norestart" />
<InstallExecuteSequence>
<Custom Action="Install_VC_redist_x86" After="InstallFinalize"><![CDATA[VCREDISTINSTALLED < "14.34.31931.0" AND NOT REMOVE]]></Custom>
</InstallExecuteSequence>
</Fragment>
You'll want to use RegistrySearch instead of util:RegistrySearch. The util:RegistrySearch is only recognized in Bundles. In WiX v4, there is a error message but in WiX v3 it is silently ignored.

How can I remove folder and sub folder using Wix installer?

I want add some extension after installation, so tried to add custom action for adding extension in using Wix but now I want remove the folder when performing uninstall action extension folder is not getting removed.
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="TargetProgram" Guid="f757ff43-0266-483a-8749-ec796cba4b25" >
<File Id="EXE" Source="C:\Windows\System32\cmd.exe" />
</Component>
</ComponentGroup>
<CustomAction Id="SetTARGETDIR"
Directory="TARGETDIR"
Value="Pathtoextensionadd"
Return="check" />
<InstallExecuteSequence>
<Custom Action="SetTARGETDIR" Before="InstallFinalize">Installed </Custom>
</InstallExecuteSequence>
<CustomAction Id='EXECUTE_AFTER_FINALIZE'
Directory='TARGETDIR'
Impersonate='yes'
Execute='deferred'
ExeCommand='command line argument that install extension in "Pathtoextensionadd"' Return='check' />
<InstallExecuteSequence>
<Custom Action="EXECUTE_AFTER_FINALIZE" Before="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
Installation is done correctly.
How can I remove that "Pathtoextensionadd" folder?
<?define AppCacheFolder ="Pathtoextensionadd" ?>
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="CacheCleanup" Guid="">
<RegistryValue Root="HKCU"
Key="$(var.AppRegKey)"
Name="CachePath"
Type="string"
Value="$(var.AppCacheFolder)"
KeyPath="yes" />
<util:RemoveFolderEx On="uninstall" Property="CACHEFOLDER" />
</Component>
</DirectoryRef>
</Fragment>
below code added under Product Tag
<?define AppRegKey ="RegPath" ?>
<Property Id="CACHEFOLDER">
<RegistrySearch Key="$(var.AppRegKey)"
Root="HKCU"
Type="raw"
Id="CacheFolderRegSearch"
Name="CachePath" />
</Property>
under feature tag
<ComponentRef Id="CacheCleanup" />

Unresolved reference to symbol 'WixComponentGroup:MyWebWebComponents' in section

I was following the below code which is product.wxs files.But I am facing an error as below:
Error 5 Unresolved reference to symbol 'WixComponentGroup:MyWebWebComponents' in section 'Product:{}'
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<Product Id="702881b5-9a64-4ab8-ab47-f3babcd950a2"
Name="WixApplication" Language="1033"
Version="1.0.0.0"
Manufacturer="HexWireless"
UpgradeCode="42b7872b-78c8-4a0b-abcd-28a30c9804ab">
<Package InstallerVersion="200" Compressed="yes" Platform="x64" InstallScope="perMachine"/>
<!--<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />-->
<!--Find the Path to the sqlcmd.exe by performing a registry search. This is hardcoded for SQL 2012.
Change 110 to 100 for 2008. Might need to change the script too.-->
<Property Id="SQLBINDIR">
<RegistrySearch Id="SqlBinDir"
Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\110\Tools\ClientSetup"
Name="Path"
Type="raw"
Win64="yes"/>
</Property>
<Condition Message="Microsoft SQL Server 2012 needs to be installed before this installer can run">
<![CDATA[SQLBINDIR]]>
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLLOCATION" Name="Database">
<Component Id="Database" Guid="a8dc2Fcd-087d-e393-b059-c67877e51b8a">
<File Id="DatabaseScript" Source="SQLScripts\HexWireless.sql"/>
<RemoveFile Id ="RemoveInstall.log" Name="Install.log" On="uninstall" />
</Component>
</Directory>
<Directory Id="INSTALLDIR" Name="PFiles">
<Directory Id="WixService" Name="Service">
<Component Id="WixWindowsServiceComponent" DiskId="1" Guid="6f51c0f3-776c-4aec-a200-1f199352c6c3" Win64="yes">
<File Id="WixService.exe" Name="WixService.exe" Source="$(var.WixService.TargetDir)\WixService.exe"/>
<ServiceInstall Id="InstallWixService" DisplayName="WixService" Name="WixService.exe" Description="WixService" Account="NT Authority\Network Service" ErrorControl="normal" Start="demand" Type="ownProcess" Vital="yes" />
<ServiceControl Id="ControlWixService" Name="WixService.exe" Stop="uninstall" Remove="uninstall" />
</Component>
</Directory>
</Directory>
<Directory Id="INSTALLFOLDER" Name="Publish">
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="WebApplication" Level="1">
<Feature Id="Database" Title="Database" Description="DatabaseScript" Level="1" Display="expand"
AllowAdvertise="no" ConfigurableDirectory="INSTALLLOCATION" Absent="allow">
<Feature Id="WixWindowsServiceComponent" Title="Service" Description="WixService" Level="1" Display="expand"
AllowAdvertise="no" ConfigurableDirectory="INSTALLDIR" Absent="allow">
<ComponentGroupRef Id="WixWebsiteIssConfiguration" />
<ComponentRef Id="Database"/>
<ComponentRef Id="WixWindowsServiceComponent"/>
<ComponentGroupRef Id="MyWebWebComponents"/>
</Feature>
</Feature>
</Feature>
<Property Id="INSTALLDIR" Value="D:" />
<Media Id="1" Cabinet="WixWindowsServiceComponent.cab" EmbedCab="yes" />
<InstallExecuteSequence>
<!--If the database feature is selected these actions will run to install the DB-->
<Custom Action="Database.cmd" After="InstallFiles" >
<![CDATA[NOT Installed]]>
</Custom>
<!--Ensure this runs after the custom action to set up the properties for its cmd line-->
<Custom Action="Database" After="Database.cmd">
<![CDATA[NOT Installed]]>
</Custom>
</InstallExecuteSequence>
<UI>
<UIRef Id="GUI"/>
<UIRef Id="WixUI_ErrorProgressText" />
</UI>
<!--This is the sequence script. Best way to understand this is by running sqlcmd -?
Use "property" Custom action to get variable substitution working-->
<CustomAction Id="Database.cmd" Property="Database"
Value=""[SQLBINDIR]sqlcmd.exe" -E -S "[SQLSERVER]" -i "[#DatabaseScript]" -o "[INSTALLLOCATION]HexWireless.log""/>
<!-- Note that the cmd line and args will come from a property with the same name as the custom action, this has been set by the custom action above -->
<CustomAction Id="Database" BinaryKey="WixCA" DllEntry="CAQuietExec" Return="check" Execute="deferred" Impersonate="yes" />
</Product>
</Wix>
Thanks In Advance.
I am not sure if your issue is sorted or not, I just faced the same issue even though i have created a few of these msi files with Wix.
In my case, it wasn't finding the "HeatedComponents" that I am generating automatically within the project. I had to load this file into the project, (these files or folders may be inside your project folder but in most cases VS does not load them automatically).
You have to Right Click on the project -> Add -> Existing Item; and select the file/item that is required.

How to create a setup project using WiX to install two Visual Studio extensions

I need to create a setup project using WiX to deploy two Visual Studio Extensions(vsix). I create a project follow the steps that you can see in this blog: Creating WiX setup for VSIX. I can compile the project and generate the .msi file, but when I am going to install the extensions, it gave me a runtime error, the error code is 2343.
The XML of the WiX project is this:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:VSExtension="http://schemas.microsoft.com/wix/VSExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="{77F7DB1E-6E8A-44DB-88FE-9E496B140A2C}" Name="Bpmn Studio" Language="1033" Version="1.0.0.0" Manufacturer="Cadic" UpgradeCode="8c57d4aa-2b56-4561-94dd-cf02b34a4747">
<Package InstallerVersion="301" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" VolumeLabel="Bpmn Studio"/>
<PropertyRef Id="VS2013DEVENV"/>
<Condition Message="Visual Studio 2013 needs to be intalled for this installation to continue.">
<![CDATA[Installed OR VS2013DEVENV]]>
</Condition>
<!--Directory structure-->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<UIRef Id="WixUI_InstallDir" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Casasoft" >
</Directory>
</Directory>
</Directory>
<Property Id="VSINSTALLDIR">
<RegistrySearch Id="VSInstallRegistry" Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\12.0" Name="InstallDir" Type="directory" />
</Property>
<CustomAction Id="SetVSIXInstaller" Return="check" Execute="immediate" Property="VSIXInstaller" Value="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\VSIXInstaller.exe" />
<CustomAction Id="DeployVSIX" Property="VSIXInstaller" Execute="deferred" Impersonate="no" ExeCommand="/quiet" Return="asyncWait"/>
<InstallExecuteSequence>
<Custom Action="DeployVSIX" After="MsiPublishAssemblies" />
</InstallExecuteSequence>
<Feature Id="BpmnStudio" Title="Bpmn Studio" Level="1">
<ComponentRef Id="BpmnStudioExtensionVSPackage" />
</Feature>
<Feature Id="ProjectTypeFeature" Title="Bpmn Studio Project Type" Level="1">
<ComponentRef Id="VSProjectTypePackage" />
</Feature>
</Product>
<Fragment>
<ComponentGroup Id="VSProjectTypeProductComponents" Directory="INSTALLFOLDER">
<Component Id="VSProjectTypePackage" Guid="BD8BA9C9-3728-4847-8428-EBECE32F79DA">
<VSExtension:VsixPackage File="VsBpmnStudioProjectTypeInstaller" PackageId="86e54529-745f-4b71-85f2-d2eb602bb777" Target="professional" TargetVersion="12.0" Vital="yes" Permanent="yes" />
<File Id="VsBpmnStudioProjectTypeInstaller" Name="BpmnStudioProject.vsix" Source="D:\Work\DSL\2013\Bpmn Studio\Common\Setup\BpmnStudioProject\bin\Debug\BpmnStudioProject.vsix" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="BpmnStudioExtension" Directory="INSTALLFOLDER">
<Component Id="BpmnStudioExtensionVSPackage" Guid="BD8BA9C9-3728-4847-8429-EBECE32F79DA">
<VSExtension:VsixPackage File="VsPackageInstaller" PackageId="86e54529-745f-4b71-85f2-d2eb602bb767" Target="professional" TargetVersion="12.0" Vital="yes" Permanent="yes" />
<File Id="VsPackageInstaller" Name="CasaSoft.BpmnStudio.DslPackage.vsix" Source="D:\Work\DSL\2013\Bpmn Studio\DslPackage\bin\Debug\CasaSoft.BpmnStudio.DslPackage.vsix" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Hi Jason: I found the empty path,Is when I set the path where I want to install the extensions in the UI Interface. The Value INSTALLALLOCATION doesn't exist. I change this value for INSTALLFOLDER and now works as I want

Non-installing MSI file

I am currently working on a tool for system administrators that can be used to update all clients of a Windows AD. It needs to work with Group Policy and SMS for the purpose of doing mass-updating. Therefore I need the tool to result in a MSI file.
Is it possible to create a MSI file that does not install anything but instead only does a custom action (ie. run a script or exe-file).
Best Regards Jakob Simon-Gaarde
Yes, it is possible. Shameful, but, possible.
You can make a square peg fit in a round hole but you lose all of the intended benefits.
FWIW, SMS is now called SCCM and it can call EXE commands.
Found a hackish way to solve my problem:
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product
Name='MVLicense Updater' Id='f8fc0a30-c138-1fe2-838b-0845200c9a66'
UpgradeCode='00ca86a0-c889-12e2-8f8b-0800200c9a66'
Language='1033' Version='1.0.0.0' Manufacturer='My Company'>
<Package Id='*' InstallerVersion='200' Compressed='yes' />
<Media Id='1' Cabinet='my.cab' EmbedCab='yes' />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder'>
<Directory Id='INSTALLDIR' Name='My-Updater'>
<Component Id='Readme' Guid='68fef080-c87b-34e2-8889-0824200c9a66'>
<File Id='ReadmeTXT' Name='readme.txt' Source='readme.txt' Vital='no' />
<RemoveFolder Id="INSTALLDIR" On="uninstall" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='Complete' Level="1">
<ComponentRef Id='Readme' />
</Feature>
<CustomAction Id="ForceError" Error="1602"/>
<CustomAction Id="RunMyUpdater" BinaryKey="MyUpdaterExe" ExeCommand="dummy" Return="check"/>
<InstallExecuteSequence>
<Custom Action='RunMyUpdater' After='InstallInitialize'></Custom>
<Custom Action="ForceError" After="RunMvlupdate"></Custom>
</InstallExecuteSequence>
<AdminExecuteSequence>
<Custom Action='RunMyUpdater' After='InstallInitialize'></Custom>
<Custom Action="ForceError" After="RunMyUpdate"></Custom>
</AdminExecuteSequence>
<Binary Id="MyUpdaterExe" SourceFile="dist\myupdater.exe" />
<UI>
<Error Id="1602">We have a problem</Error>
</UI>
</Product>
</Wix>
This does the job of running my executable that does some configuration stuff based on calling an internet service and then rolls back the installation because I force an error to occure.

Resources