Skip to content

Commit

Permalink
* Issue #10:*.g.wxs not created in TeamCity build
Browse files Browse the repository at this point in the history
* Added MSBuild.EmitAutoGenFiles
  • Loading branch information
oleg-shilo committed Feb 15, 2017
1 parent 8dcc4f3 commit 333886f
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ static public void Main(string[] args)
new Certificate("NameOfCert2", StoreLocation.currentUser, StoreName.personal, @"Path\to\cert\file", authorityRequest:false));

project.UI = WUI.WixUI_InstallDir;
//project.PreserveTempFiles = true;
project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");

Compiler.BuildMsi(project);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class EmptyDialogSetup
{
public static void Build()
{
var project = new Project("CustomDialogTest",
var project = new Project("CustomDialogTest",
new Dir(@"%ProgramFiles%\My Company\My Product",
new File("setup.exe")));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static public void Main()
static void Project_UILoaded(SetupEventArgs e)
{
var msiFile = e.Session.Database.FilePath;

// Simulate analyzing the runtime conditions with the message box.
// Make a decision to show (or not) Licence dialog by injecting it in the Dialogs collection
if (MessageBox.Show("Do you want to inject 'Licence Dialog'?", "Wix#", MessageBoxButtons.YesNo) == DialogResult.Yes)
Expand Down
Binary file modified Source/src/WixSharp.Samples/WixSharp.Msi.dll
Binary file not shown.
Binary file modified Source/src/WixSharp.Samples/WixSharp.UI.dll
Binary file not shown.
8 changes: 4 additions & 4 deletions Source/src/WixSharp.Samples/WixSharp.UI.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Source/src/WixSharp.Samples/WixSharp.dll
Binary file not shown.
24 changes: 18 additions & 6 deletions Source/src/WixSharp.Samples/WixSharp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,7 @@
</member>
<member name="F:WixSharp.Compiler.AssemblyResolve">
<summary>
The assembly resolve handler. If it is set then it will be used for all assembly probing (AppDomain.AssemblyResolve event) performed in all
The assembly resolve handler. If it is set then it will be used for all assembly probing (AppDomain.AssemblyResolve event) performed in all
AppDomains.
</summary>
</member>
Expand All @@ -2098,8 +2098,8 @@
The default value is the content of environment variable <c>WIXSHARP_WIXDIR</c>.
<para>If user does not set this property explicitly and WIXSHARP_WIXDIR is not defined
<see cref="T:WixSharp.Compiler"/> will try to locate WiX binaries in well known locations in this order:
<para><c>&lt;solution_dir&gt;\packages\WixSharp.wix.bin.&lt;max_version&gt;\tools\bin</c></para>
<para><c>Program Files\Windows Installer XML v&lt;max_of 3*&gt;\bin</c></para>
<para><c>&lt;solution_dir&gt;\packages\WixSharp.wix.bin.&lt;max_version&gt;\tools\bin</c></para>
<para><c>Program Files\Windows Installer XML v&lt;max_of 3*&gt;\bin</c></para>
</para>
</summary>
<value>The WiX binaries' location.</value>
Expand Down Expand Up @@ -2156,7 +2156,7 @@
</member>
<member name="F:WixSharp.Compiler.TempFiles">
<summary>
The collection of temporary files created by compiler routine(s). These files will always be deleted unless Project/Compiler
The collection of temporary files created by compiler routine(s). These files will always be deleted unless Project/Compiler
PreserveTempFiles property is set to true;
</summary>
</member>
Expand Down Expand Up @@ -2714,10 +2714,9 @@
new Dir(@"%ProgramFiles64Folder%\My Company\My Product",
new InternetShortcut
{
Id = "OnlineDocumentationShortcut",
Name = "My Online Documentation",
Target = "https://github.com/oleg-shilo/wixsharp"
},
},
...

project.BuildMsi();
Expand Down Expand Up @@ -7696,6 +7695,19 @@
when 'project.Platform = Platform.x64'
</summary>
</member>
<member name="T:WixSharp.MSBuild">
<summary>
Settings class for controlling MSBuild integration.
</summary>
</member>
<member name="P:WixSharp.MSBuild.EmitAutoGenFiles">
<summary>
Indicates whether compiler should emit "&lt;projDir&gt;\wix\&lt;projName&gt;.g.wxs" file.
<para> If set to <c>true</c> the Wix# compiler will also update te project file with the inclusion
of the autogenerated file(s) with "Build Action" set to <c>None</c>.
</para>
</summary>
</member>
<member name="T:WixSharp.XDocumentGeneratedDlgt">
<summary>
Delegate for <see cref="T:WixSharp.Compiler"/> event <c>WixSourceGenerated</c>
Expand Down
30 changes: 15 additions & 15 deletions Source/src/WixSharp.UI/ManagedUI/MsiRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ namespace WixSharp
* Expected to be like this:
* Property Name Install Uninstall Repair Modify Upgrade
* --------------------------------------------------------------------------------------
* Installed False True False True True
* REINSTALL True False True False False
* UPGRADINGPRODUCTCODE True False True True True
*
* Installed False True False True True
* REINSTALL True False True False False
* UPGRADINGPRODUCTCODE True False True True True
*
* Though in the reality it is like this:
* Property Name Install Uninstall Repair Modify Upgrade
* ---------------------------------------------------------------------------------------------------
* Installed <null> 00:00:00 00:00:00 00:00:00 <00:00:00>
* REINSTALL <null> <null> All <null> <null>
* Installed <null> 00:00:00 00:00:00 00:00:00 <00:00:00>
* REINSTALL <null> <null> All <null> <null>
* UPGRADINGPRODUCTCODE <null> <null> <null> <null> <not empty>
*
*
* */



/// <summary>
/// Represents MSI runtime context. This class is to be used by ManagedUI dialogs to interact with the MSI session.
/// Represents MSI runtime context. This class is to be used by ManagedUI dialogs to interact with the MSI session.
/// </summary>
public class MsiRuntime
{
Expand All @@ -47,16 +47,16 @@ public class MsiRuntime
/// Cancels the execution of the MSI installation, which is already started (progress is displayed).
/// </summary>
public System.Action CancelExecute;

/// <summary>
/// The session object.
/// </summary>
public Session Session;

//DOESN'T work reliably. For example if no InstallDir dialog is displayed the MSI session does not have "INSTALLDIR" property initialized.
//The other properties (e.g. UI Level) are even never available at all.
//It looks like Session is initialized/updated correctly for the 'custom actions' session but not for the 'Embedded UI' session.
//In fact because of these problems a session object can no longer be considered as a single connection point between all MSI runtime modules.
//It looks like Session is initialized/updated correctly for the 'custom actions' session but not for the 'Embedded UI' session.
//In fact because of these problems a session object can no longer be considered as a single connection point between all MSI runtime modules.
internal void CaptureSessionData()
{
try
Expand All @@ -75,12 +75,12 @@ internal void CaptureSessionData()
catch { }
}
/// <summary>
/// Repository of the session properties to be captured and transfered to the deferred CAs.for
/// Repository of the session properties to be captured and transfered to the deferred CAs.
/// </summary>
public Dictionary<string, string> Data = new Dictionary<string, string>();

/// <summary>
/// Localization map.
/// Localization map.
/// </summary>
public ResourcesData UIText = new ResourcesData();

Expand Down Expand Up @@ -143,7 +143,7 @@ public Bitmap GetMsiBitmap(string name)

/// <summary>
/// Localizes the specified text.
/// <para>The localization is performed according two possible scenarios. The method will return the match form the MSI embedded localization file.
/// <para>The localization is performed according two possible scenarios. The method will return the match form the MSI embedded localization file.
/// However if it cannot find the match the method will try to find the and return the match from the MSI session properties.</para>
/// <para>This method is mainly used by 'LocalizeWith' extension for a single step localization of WinForm controls.</para>
/// </summary>
Expand Down Expand Up @@ -206,7 +206,7 @@ public void InitFromWxl(byte[] wxlData)
try
{
System.IO.File.WriteAllBytes(tempXmlFile, wxlData);
doc = XDocument.Load(tempXmlFile); //important to use Load as it will take care about encoding magic first bites of wxlData, that came from the localization file
doc = XDocument.Load(tempXmlFile); //important to use Load as it will take care about encoding magic first bites of wxlData, that came from the localization file
}
catch
{
Expand Down
Loading

0 comments on commit 333886f

Please sign in to comment.