From d0dbd56aab066d43e9939d9815be38fbb330d956 Mon Sep 17 00:00:00 2001
From: Glatzemann <glatzemann@users.noreply.github.com>
Date: Fri, 27 Jan 2012 17:15:57 +0000
Subject: [PATCH] - fixed some build errors in ANX.InputSystem.Recording when
 using the CLI MSBuild tasks - improved the installer and added a start menu
 folder with ANX2XNA Converter, ANXStatusComparer, ANX.Framework website and a
 uninstall link

---
 .../ANX.InputSystem.Recording/Creator.cs      |  2 +
 .../RecordingMotionSensingDevice.cs           | 11 ++--
 Installer/anx.wxs                             | 54 +++++++++++++++++--
 build/ANX.Framework.build                     |  5 +-
 4 files changed, 60 insertions(+), 12 deletions(-)

diff --git a/InputSystems/ANX.InputSystem.Recording/Creator.cs b/InputSystems/ANX.InputSystem.Recording/Creator.cs
index f291371b..ebd9e499 100644
--- a/InputSystems/ANX.InputSystem.Recording/Creator.cs
+++ b/InputSystems/ANX.InputSystem.Recording/Creator.cs
@@ -62,7 +62,9 @@ namespace ANX.InputSystem.Recording
         RecordingMouse mouse;
         RecordingKeyboard keyboard;
         RecordingGamePad gamePad;
+#if XNAEXT
         RecordingMotionSensingDevice msd;
+#endif
         
         public IGamePad GamePad
         {
diff --git a/InputSystems/ANX.InputSystem.Recording/RecordingMotionSensingDevice.cs b/InputSystems/ANX.InputSystem.Recording/RecordingMotionSensingDevice.cs
index ba65c734..5c65b644 100644
--- a/InputSystems/ANX.InputSystem.Recording/RecordingMotionSensingDevice.cs
+++ b/InputSystems/ANX.InputSystem.Recording/RecordingMotionSensingDevice.cs
@@ -1,13 +1,13 @@
-#if XNAEXT
-
-#region Using Statements
+#region Using Statements
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using ANX.Framework.NonXNA;
 using ANX.Framework.Graphics;
+#if XNAEXT
 using ANX.Framework.Input.MotionSensing;
+#endif
 
 #endregion
 
@@ -60,6 +60,8 @@ using ANX.Framework.Input.MotionSensing;
 
 namespace ANX.InputSystem.Recording
 {
+#if XNAEXT
+
     /// <summary>
     /// Wrapper aroung another IMotionSensingDevice, will record all inputs and allows playback.
     /// </summary>
@@ -92,6 +94,5 @@ namespace ANX.InputSystem.Recording
             throw new NotImplementedException();
         }
     }
+#endif
 }
-
-#endif
\ No newline at end of file
diff --git a/Installer/anx.wxs b/Installer/anx.wxs
index 660b6be2..f34e6fca 100644
--- a/Installer/anx.wxs
+++ b/Installer/anx.wxs
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
+     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
 	<Product Id="{B7ABDA84-7163-4892-9AA1-814C6CDAAF54}" 
            Name="ANX.Framework" 
            Language="1033" 
@@ -15,6 +16,11 @@
 			<ComponentGroupRef Id="ProductComponents" />
 		</Feature>
 
+    <Feature Id="Tools" Title="ANX.Framework tools" Level="1">
+      <ComponentGroupRef Id="Tools" />
+      <ComponentRef Id="ApplicationShortcut" />
+    </Feature>
+    
     <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
     <WixVariable Id="WixUILicenseRtf" Value="../doc/license.rtf" />
     <WixVariable Id="WixUIBannerBmp" Value="../media/ANX.Framework.Logo_493x58.bmp" />
@@ -27,12 +33,50 @@
 	<Fragment>
 		<Directory Id="TARGETDIR" Name="SourceDir">
 			<Directory Id="ProgramFilesFolder">
-				<Directory Id="INSTALLFOLDER" Name="ANX.Framework" />
+        <Directory Id="INSTALLFOLDER" Name="ANX.Framework">
+          <Directory Id="TOOLSFOLDER" Name="Tools" />
+        </Directory>
 			</Directory>
-		</Directory>
-	</Fragment>
+      <Directory Id="ProgramMenuFolder">
+        <Directory Id="ApplicationProgramsFolder" Name="ANX.Framework" />
+      </Directory>
+    </Directory>
+  </Fragment>
 
-	<Fragment>
+  <Fragment>
+    <DirectoryRef Id="ApplicationProgramsFolder">
+      <Component Id="ApplicationShortcut" Guid="{7A7BEBDF-BE65-413E-A993-8E78311B445D}">
+        <Shortcut Id="ApplicationStartMenuShortcut"
+                  Name="ANX Status Comparer"
+                  Description="compare the development status between ANX and XNA"
+                  Target="[TOOLSFOLDER]asc.exe"
+                  WorkingDirectory="TOOLSFOLDER"/>
+        <Shortcut Id="ApplicationStartMenuShortcut2"
+                  Name="XNA to ANX converter"
+                  Description="convert XNA projects to ANX"
+                  Target="[TOOLSFOLDER]x2a.exe"
+                  WorkingDirectory="TOOLSFOLDER"/>
+        <util:InternetShortcut Id="OnlineDocumentationShortcut"
+                               Name="ANX.Framework WebSite"
+                               Target="http://anxframework.codeplex.com/"/>
+        <Shortcut Id="UninstallProduct"
+                                  Name="Uninstall ANX.Framework"
+                                  Description="Uninstalls the ANX.Framework from your system"
+                                  Target="[System64Folder]msiexec.exe"
+                                  Arguments="/x [ProductCode]"/>
+        <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
+        <RegistryValue Root="HKCU" Key="Software\Microsoft\ANX.Framework" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
+      </Component>
+    </DirectoryRef>
+  </Fragment>
+  
+  <Fragment>
+    <ComponentGroup Id="Tools" Directory="TOOLSFOLDER">
+      <Component Id='ANX.Tools' Guid='{4EC562B1-DCE2-48C8-A29A-3EC6C1F588E0}'>
+        <File Id='XNA2ANXConverter' Name='x2a.exe' DiskId='1' Source='../Tools/bin/x2a.exe' />
+        <File Id='ANXStatusComparer' Name='asc.exe' DiskId='1' Source='../Tools/bin/asc.exe' />
+      </Component>
+    </ComponentGroup>
 		<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
       <Component Id='ANX.Framework' Guid='{8A3AA04E-9325-441E-B16A-731676449C0B}'>
         <File Id='license' Name='license.txt' DiskId='1' Source='../doc/license.txt' />
diff --git a/build/ANX.Framework.build b/build/ANX.Framework.build
index b518160c..2b1ff93a 100644
--- a/build/ANX.Framework.build
+++ b/build/ANX.Framework.build
@@ -144,6 +144,7 @@
       <arg value='/p:Platform="${build.platform}"'/>
       <arg value="/p:OutputPath=../${build.dir}/${build.configuration}" />
       <arg value='/p:DefineConstants="${project.anx.directives}"' />
+      <arg value="/p:AllowUnsafeBlocks=true" />
       <arg value="/clp:ErrorsOnly" />
       <arg value="${project.anx.path.rendersystem.gl3}/${project.anx.name.rendersystem.gl3}.csproj" />
     </exec>
@@ -387,7 +388,7 @@
     <property name="wix.dir" value="${path::combine(environment::get-variable('WIX'), 'bin')}" readonly="true" />
     <loadtasks assembly="${wix.dir}\Microsoft.Tools.WindowsInstallerXml.NAntTasks.dll" />
 
-    <candle out="${build.dir}/${build.configuration}/installer/" exedir="${wix.dir}">
+    <candle out="${build.dir}/${build.configuration}/installer/" exedir="${wix.dir}" extensions="WixUIExtension;WiXUtilExtension">
       <sources>
         <include name="../Installer/anx.wxs" />
       </sources>
@@ -402,7 +403,7 @@
       warningsaserrors="true"
       suppressices="ICE57"
       cultures="en-us"
-      extensions="WixUIExtension"
+      extensions="WixUIExtension;WiXUtilExtension"
       rebuild="true"
       suppresspdb="true">
       <!-- Specify additional options -->