I am creating a WIX bundle which calls an executable.
In that call I'm trying to pass the installfolder as an argument but for some reason this doesn't seem to work.
The bundle:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="$(var.Department) $(var.ProductName)"
Version="!(bind.packageVersion.Database.CLI.Verify)"
Manufacturer="$(var.Company) $(var.Department)"
UpgradeCode="5fc4dc21-0202-4e28-b8a4-b87f972ae32e"
DisableRemove="yes"
DisableModify="yes"
IconSourceFile="Database.ico">
<util:RegistrySearchRef Id='VerifyDotnetVersion' />
<Variable Name="InstallFolder" Type="string" Value="c:\$(var.Company)"/>
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<!-- LicenseUrl intentionally empty. -->
<bal:WixStandardBootstrapperApplication LicenseUrl=""
LogoFile="Database.png"
SuppressOptionsUI="no"
SuppressRepair="yes"/>
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="SqlServer2019ExpressLocalDB" />
<PackageGroupRef Id="Database.CLI"/>
</Chain>
</Bundle>
<Fragment>
<util:FileSearch Id='VerifyDotnetVersion'
Variable="DotnetVersion"
Path="dotnet.exe"
Result="version" />
<bal:Condition Message="This installer requires at least dotnet version 6.">
DotnetVersion >= v6
</bal:Condition>
</Fragment>
</Wix>
And the part that is calling the ExePackage:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<PackageGroup Id="Database.CLI">
<ExePackage Id="Database.CLI.Verify"
DisplayName="Check whether SqlLocalDb has been installed."
SourceFile="$(var.SourceFile)"
InstallCommand="verify"
UninstallCommand="remove"
Vital="yes"
Compressed="no"
PerMachine="yes"
Permanent="no">
<ExitCode Value="0" Behavior="success" />
<ExitCode Value="1" Behavior="error" />
<ExitCode Value="5" Behavior="error" />
<ExitCode Value="31" Behavior="error" />
<ExitCode Value="183" Behavior="success" />
<ExitCode Value="574" Behavior="error" />
<ExitCode Value="3010" Behavior="forceReboot" />
</ExePackage>
<ExePackage Id="Database.CLI.Attach"
DisplayName="Attach database to the SqlLocalDb instance."
SourceFile="$(var.SourceFile)"
InstallCommand="attach Target="[INSTALLFOLDER]\$(var.Department)\$(var.ProductName)""
Vital="yes"
Compressed="no"
PerMachine="yes">
<ExitCode Value="0" Behavior="success" />
<ExitCode Value="1" Behavior="error" />
<ExitCode Value="5" Behavior="error" />
<ExitCode Value="31" Behavior="error" />
<ExitCode Value="183" Behavior="success" />
<ExitCode Value="574" Behavior="error" />
<ExitCode Value="3010" Behavior="forceReboot" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>
When I look in the logs I see as argument:
[7A60:546C][2022-06-16T16:44:15]i301: Applying execute package: Database.CLI.Attach, action: Install, path: C:\ProgramData\Package Cache\0FD93FB1FD9BBE5B46CC123351ECE9DBCEC54E9D\Database.CLI.exe, arguments: '"C:\ProgramData\Package Cache\0FD93FB1FD9BBE5B46CC123351ECE9DBCEC54E9D\Database.CLI.exe" attach Target="\Analytics\Database"'
But I'm missing the contents of the [INSTALLFOLDER] so what I expect should be something like Target="c:\temp\Analytics\Database".
What am I missing here?
p.s. Is it also possible to provide an INSTALLFOLDER when launching the setup-bundle for silent installs? Like Database.Setup.exe InstallLocation=c:\temp
Many thanks in advance.
Burn variables are case-sensitive, so use [InstallFolder], not [INSTALLFOLDER].
Getting ERR_CLEARTEXT_NOT_PERMITTED error. I have tried every thing change my config.xml , network_config getting update automatically when i add my domain. ionic cli is 5.4.13
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MyApp</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi#ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<platform name="android">
<access origin="*" />
<preference name="android-usesCleartextTraffic" value="true" />
<allow-navigation href="*" />
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="#xml/network_security_config" />
<application android:usesCleartextTraffic="true" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
<allow-intent href="market:*" />
</platform>
</widget>
You can use ionic cordova http plugin for network request your error maybe solve.
Here is link for that
https://ionicframework.com/docs/native/http
I'm having trouble calling CheckUrlAccessForPrincipal(..) in the UrlAuthorizationModule.
It' seems like HttpApplication.IntegratedModuleList is null.
My web.config section around modules looks like
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="InitializationModule" type="EPiServer.Framework.Initialization.InitializationModule, EPiServer.Framework" preCondition="managedHandler" />
<add name="UrlRewriteModule" type="EPiServer.Web.RoutingUrlRewriteModule, EPiServer" preCondition="managedHandler" />
<add name="ShellRoutingModule" type="EPiServer.Shell.Web.Routing.ShellRoutingModule, EPiServer.Shell" />
<add name="BusinessFoundationInitializeModule" preCondition="managedHandler" type="Mediachase.Commerce.Core.Modules.BusinessFoundationInitializeModule, Mediachase.Commerce" />
<add name="ProfileModule" type="EPiServer.Business.Commerce.HttpModules.ProfileModule, EPiServer.Business.Commerce" />
</modules>
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="ReportingHttpHandler" preCondition="integratedMode" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
....
</system.webServer>
The problem arose when upgrading from MVC4 to MVC5, and the packages connected to this. I dont know if it has anything specific to do with this.
My nuget packages is
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AuthorizeNet" version="1.8.10" targetFramework="net45" />
<package id="Castle.Core" version="3.3.3" targetFramework="net45" />
<package id="Castle.Windsor" version="3.3.0" targetFramework="net45" />
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
<package id="EPiCode.SqlBlobProvider" version="1.4.2" targetFramework="net45" />
<package id="EPiServer.CMS.Core" version="10.3.1" targetFramework="net45" />
<package id="EPiServer.Commerce.Core" version="10.2.2" targetFramework="net45" />
<package id="EPiServer.CommerceManager" version="10.2.2" targetFramework="net45" />
<package id="EPiServer.Framework" version="10.3.1" targetFramework="net45" />
<package id="EPiServer.Logging.Log4Net" version="2.1.0" targetFramework="net45" />
<package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Lucene.Net" version="3.0.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Providers.Core" version="2.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.ReportViewer.Common" version="10.0.40219.1" targetFramework="net45" />
<package id="Microsoft.ReportViewer.WebForms" version="10.0.40219.1" targetFramework="net45" />
<package id="Microsoft.Tpl.Dataflow" version="4.5.24" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
<package id="SlowCheetah" version="2.5.14" targetFramework="net45" />
<package id="structuremap.web-signed" version="3.1.6.186" targetFramework="net45" />
<package id="structuremap-signed" version="3.1.9.463" targetFramework="net45" />
</packages>
I don't know if it's a web.config thing, but I suspect it.
The problem was, the code ran before the application context had been set.
Had to check if the HttpContext.Current.ApplicationInstance == null
I am publishing an ASP.NET Core 1.1 project with .csproj file ...
When I publish it the project is compiled and all the files, including the ones in wwwroot are copied, but all appsettings.*.json files are missing.
I am not sure why because I have the following:
<Content Include="**\*.json" />
What am I missing? Here is the complete .csproj file.
<Project>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<Content Include="**\*.json" />
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Runtime" Version="4.3.0" />
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Sdk.Web" Version="1.0.0-alpha-20161104-2-112">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Tools" Version="1.1.0-preview4-final" />
<PackageReference Include="Microsoft.AspNetCore.ResponseCaching" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.0.0-msbuild1-final" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="Prepublish" BeforeTargets="PrepareForPublish" Condition=" '$(IsCrossTargetingBuild)' != 'true' ">
<Exec Command="npm install" />
<Exec Command="bower install" />
<Exec Command="gulp build" />
</Target>
</Project>
I had a similar issue with four json files I was using as translation files for angular-translate. What I did to include them was explicitly mark them as content.
<Content Include="Language\locale-en.json" />
<Content Include="Language\locale-fr.json" />
<Content Include="Language\locale-es.json" />
<Content Include="Language\locale-pt.json" />
I'm using WIX 3.8 to create my setup file. This is my Product.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="{D16E42B5-3C6F-4EE5-B2F4-727BF8B74A92}" Name="My setup" Language="1033" Version="1.0.0.0" Manufacturer="Me" UpgradeCode="9279b740-8419-45c4-9538-6a45f8e949c7">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Media Id="1" Cabinet="WCF.cab" EmbedCab="yes" />
<Feature Id="ProductFeature" Title="Wcf.Setup" Level="1">
<ComponentGroupRef Id="WCFComponents" />
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INETPUB" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INETPUB" Name="Inetpub">
<Directory Id="INSTALLFOLDER" Name="WCF">
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
And here is the build file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebSiteSource>..\WCF\</WebSiteSource>
<SetupF>..\Setup\</SetupF>
<PublishF>publish\</PublishF>
<Publish>$(SetupF)$(PublishF)</Publish>
<WebSiteContentCode>WebSiteContent.wxs</WebSiteContentCode>
<WebSiteContentObject>WebSiteContent.wixobj</WebSiteContentObject>
<MsiOut>bin\Release\WCF.msi</MsiOut>
<WixPath>C:\PROGRA~2\WIXTOO~1.8\bin\</WixPath>
</PropertyGroup>
<ItemGroup>
<WebSiteContent Include="$(WebSiteContentCode)" />
</ItemGroup>
<ItemGroup>
<WixCode Include="Product.wxs" />
<WixCode Include="$(WebSiteContentCode)" />
</ItemGroup>
<ItemGroup>
<WixObject Include="Product.wixobj" />
<WixObject Include="$(WebSiteContentObject)" />
</ItemGroup>
<Target Name="Build">
<MSBuild
Projects="..\TMS.sln"
Targets="ReBuild"
Properties="Configuration=Release" />
</Target>
<Target Name="PublishWebsite">
<Message Text="Removing publish directory: $(SetupF)"/>
<RemoveDir Directories="$(SetupF)" ContinueOnError="false" />
<Message Text="Start to publish website" Importance="high" />
<MSBuild
Projects="..\\WCF\WCF.csproj"
Targets="ResolveReferences;_CopyWebApplication"
Properties="OutDir=$(Publish)bin\;WebProjectOutputDir=
$(Publish);Configuration=Release" />
</Target>
<Target Name="Harvest">
<Exec
Command='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg WCFComponents -var var.publishDir -gg -out $(WebSiteContentCode)'
ContinueOnError="false"
WorkingDirectory="." />
</Target>
<Target Name="WIX">
<Exec
Command='"$(WixPath)candle" -ext WixIISExtension -ext WixUtilExtension -ext WixSqlExtension -dpublishDir=$(Publish) -dMyWebResourceDir=. #(WixCode, ' ')'
ContinueOnError="false"
WorkingDirectory="." />
<Exec
Command='"$(WixPath)light" -ext WixIISExtension -ext WixUIExtension -ext WixUtilExtension -ext WixSqlExtension -out $(MsiOut) #(WixObject, ' ')'
ContinueOnError="false"
WorkingDirectory="." />
<Message Text="Install package has been created." />
</Target>
<Target Name="DeleteTmpFiles">
<RemoveDir Directories="$(Publish)" ContinueOnError="false" />
<RemoveDir Directories="$(SetupF)" ContinueOnError="false" />
<Delete Files="#(WixObject);#(WebSiteContent)" />
</Target>
</Project>
I always receive the error message: Product.wxs(10): error LGHT0094: Unresolved reference to symbol 'WixComponentGroup:WCFComponents' in section 'Product:{D16E42B5-3C6F-4EE5-B2F4-727BF8B74A92}'.
I copied exactly the source code from this topic http://blog.bartdemeyer.be/2013/10/create-an-installer-for-website-with-wix-part-1/ to my project but the source code from here runs property but mine doesn't work.
Could you please help me to solve this problem? Thanks a lot.
I solved this problem by removing Build parameter from command line.
It should be:
msbuild setup.build /t:Build;PublishWebSite;Harvest;WIX;DeleteTmpFiles
The reason is you can’t build your solution because MyProject.Setup can’t be built.