January 19, 2017, 4:08 pm
Hi, what should go in the FileAssociation Icon property? Is it the path of the icon or (as the comments tell us) is it a reference to other wix entity?
This
thread suggests adding an Icon xml tag and then reference it in the FileAssociation icon property, however there is no Icon class in the WixSharp library.
↧
January 19, 2017, 8:16 pm
OK. I have managed to test your scenario (at least a UI part of it).
The event you need to hook up to is
UILoaded
. It is called when UI shell is created and the first dialog is prepared for display.
UInitialized
event is actually not suitable for the task as at this stage the dialogs sequence is not ready.
I also reflected dynamic Dialog sequence creation in the sample here:
https://github.com/oleg-shilo/wixsharp/commit/9d6b86d601e89694b3658f1843defb3ca17f0df3
project.UILoaded += Project_UILoaded;
...
staticvoid Project_UILoaded(SetupEventArgs e)
{
// Simulate analyzing the runtime conditions with the message box.// Make a decision to show (or not) Licence dialog by injecting it in the Dialogs collectionif (MessageBox.Show("Do you want to inject 'Licence Dialog'?", "Wix#", MessageBoxButtons.YesNo) == DialogResult.Yes)
e.ManagedUIShell.CurrentDialog.Shell.Dialogs.Insert(1, Dialogs.Licence);
}
Your
dialog_Load
is not much different and should work UI wise. Though keep in mind that in both cases when the event handler is invoked the first dialog is already displayed so
Shell.Dialogs.Clear();
doesn't seems right and I used
Dialogs.Insert(1,...
instead.
I have tested my sample and I the UI part works as expected. The 'Licence' dialog is injected depending on the user MessageBox response.
However you need to be aware that your typically your OS shell will invoke your msi (via msiexec.exe) in the install/modify.repair/uninstall mode and the UI sequence reflects this mode one or another way. But I cannot exclude that just changing the way UI looks (dialog sequence) will automatically change the actual mode. The chances are that it will but you will need to test it.
↧
↧
January 19, 2017, 10:03 pm
Thank you for the assistance
↧
January 20, 2017, 4:56 am
This is what WiX documentation says:
For an advertised ProgId, the Id of an Icon element. For a non-advertised ProgId, this is the Id of a file containing an icon resource.
I know, it's not very clear/intuitive.
By default Wix# automatically links the Icon attribute to the parent file (e.g. exe file) thus the associated icon will be extracted from the exe resources at the index
IconIndex
(0 by default). I am not sure if WiX consider *.ico file as an "icon resource" (as opposite to exe files). If it does then you can add the icon file as
new File(new Id("app_ico"), "app.ico")
with further
FileAssociation.Icon = "app_ico"
.
Though for the advertised setups according WiX spec it needs to be an
Icon
class. Wix# doesn't support
Icon
element directly so you will need to add it to inject it in a post-action:
project.WixSourceGenerated += Compiler_WixSourceGenerated;
...
staticvoid Compiler_WixSourceGenerated(XDocument document)
{
document.Root
.Select("Product")
.AddElement("Icon", "Id=app_ico; SourceFile=app.ico");
...
If you feel that direct support for Icon element is trully beneficial please log it as a feature request on
https://github.com/oleg-shilo/wixsharp
↧
January 24, 2017, 2:04 am
Now it is WiX v3.10.3 (Stable). It was released in the summer of 2016.
↧
↧
January 24, 2017, 7:36 am
Is there a way to include "MspPackage" package types in Bundles?
↧
January 24, 2017, 6:01 pm
Wix# Bundle doesn't support
MspPackage
directly. Please add it as a feature request on GitHub/WixSharp.
In a mean time you can ad the element manually. I have extended the Bootstrapper sample with the demo for adding
MspPackage
element:
bootstrapper.WixSourceGenerated += (doc) => doc.FindSingle("Chain")
.AddElement("MspPackage",
"SourceFile=Patch.msp; Slipstream=no");
↧
January 24, 2017, 6:54 pm
Done in v1.3.0.
https://github.com/oleg-shilo/wixsharp/releases
Wix# release package includes WiX binaries of the version that Wix# was tested against and it is not always the latest WiX release.
Please note that you can always install any version of WiX on your system and Wix# will find it in the %PROGRAMFILES% unless you have Wix# compilers configured to use an alternative WiW release.
↧
January 25, 2017, 2:25 am
im trying install .net in my installer
my code base on one of the threads here
string msiproject = buildmsi();
var bootstrapper = new Bundle(productname,
new PackageGroupRef("NetFx461Web"),
new MsiPackage(msiproject) { DisplayInternalUI = true });
bootstrapper.Version = new Version("1.0.0.0");
bootstrapper.UpgradeCode = new Guid("929339fd-c7c1-43eb-9fad-a24a23b99802");
bootstrapper.Application = new SilentBootstrapperApplication();
bootstrapper.Build();
im getting an errors:
The Windows Installer XML variable 'WixMbaPrereqPackageId' is declared in more than one location. Please remove one of the declarations.
The Windows Installer XML variable 'WixMbaPrereqLicenseUrl' is declared in more than one location. Please remove one of the declarations.
also im new in wix so im not sure if this just build .net install file or automaticly install it
thanks
↧
↧
January 25, 2017, 6:29 pm
Have a look at
Bundle.SuppressWixMbaPrereqVars
. It should solve your problem.
Can you also confirm that the build output contains the Wix# generated warning indicating the solution to the problem?
======================================================
WARNING: It looks like one of the packages defines WixMbaPrereqPackageId/WixMbaPrereqLicenseUrl in addition to the definition auto-inserted by Wix# managed BA. If it is the case set your Bundle project SuppressWixMbaPrereqVars to true to fix the problem.
======================================================
Please use
GitHub for further discussions as this website is no longer active.
↧
January 25, 2017, 11:18 pm
Yes i see the warning.
The problem solved.
Thank you.
↧
January 27, 2017, 5:28 am
wix has some property called internetshortcut
<util:InternetShortcut Id="OnlineDocumentationShortcut"
Name="My Online Documentation"
Target="http://wixtoolset.org/"/>
is it not available in Wix#?
↧
January 27, 2017, 4:15 pm
InternetShortcut
as some other non-mainstream WiX elements is supported via custom user defined code elements. The whole InjectXML sample is dedicated to the technique.
In your case you need to define a little
InternetShortcut
class and then use it in the project declaration:
var project =
new Project("MyProduct",
new Dir(@"%ProgramFiles64Folder%\My Company\My Product",
new InternetShortcut
{
Id = "OnlineDocumentationShortcut",
Name = "My Online Documentation",
Target = "http://wixtoolset.org"
},
...
publicclass InternetShortcut : WixEntity, IGenericEntity
{
[WixSharp.Xml]
newpublicstring Id;
[WixSharp.Xml]
newpublicstring Name;
[WixSharp.Xml]
publicstring Target;
publicvoid Process(ProcessingContext context)
{
var util = WixExtension.Util;
//reflect new dependency
context.Project.IncludeWixExtension(util);
//serialize itself and add to the parent component
context.XParent
.FindSingle("Component")
.Add(this.ToXElement(util, "InternetShortcut"));
}
}
The Wix# strategy is to include (into the distribution) direct support for the less popular/frequent elements only in response to the user demand. If you feel that support
InternetShortcut
needs to be available directly (out of box) then please log the feature request on the project home page:
https://github.com/oleg-shilo/wixsharp.
↧
↧
January 28, 2017, 2:54 am
Hi,
i want to say something like that:
new Project("MyProject",
new Dir(@"%ProgramFiles%\MyProject",
new File(
@"..\bin\$(var.MyProject.PlatformName)\$(var.MyProject.ConfigurationName)\MyProject.exe")));
I get : "error CNDL0150: Undefined preprocessor variable '$(var.MyProject.PlatformName)'" ?
Regards
PS: a reference to project "MyProject" was added!
↧
January 28, 2017, 3:47 am
Hi oleg,
is there an example showing how to change registry permissions?
Regards
Martin
↧
January 30, 2017, 2:11 am
Hi Oleg,
first at all you do good job with Wix#. Thanks.
I have some questions and hope that you can give me some answers.
- I got System.IO.FileNotFoundException for my CustomAction.dll. Do i something wrong ?
I tried execute some c# code in Uninstall. How do i execute Custom Action during Uninstall or Install ? .NET Framework is 3.5 for Project and .Dll as Target. - I can choose InstallDir. How do i search in Registry for Key during Installation? I need special Key from Registry where another Software installed. I need registren mydll as com during installation. How can i do this ?
Im new in Wix and need starthelp.
Thanls a lot for answers
↧
January 30, 2017, 3:07 am
Hi, Oleg!
How can I change ManagedUI dialogs language to russain (in VisualStudio 2013 Managed Setup Custom Dialog progect)?
I set project.Language="ru-RU", project.Codepage="windows-1251", but it has no effect, dialogs text is english.
project.LightOptions += "-cultures: \"ru-RU\"" has no effect too
↧
↧
January 30, 2017, 4:02 am
Have a look at CustomUIDialog sample from Downloadable samples. It uses German localization.
Please use GitHub (
https://github.com/oleg-shilo/wixsharp) for further discussions.
Just trying to make it more noticeable that Wix# has moved to GitHub
↧
January 30, 2017, 4:05 am
↧
January 30, 2017, 4:06 am
↧