diff --git a/Builder/Builder.csproj b/Builder/Builder.csproj new file mode 100644 index 0000000..55c08ce --- /dev/null +++ b/Builder/Builder.csproj @@ -0,0 +1,110 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {D8D6EFEC-76D7-4870-BD71-C90FA6D7368A} + Exe + Properties + Builder + Builder + v3.5 + 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + .\ + TRACE + prompt + 4 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + False + C:\Program Files (x86)\Windows Installer XML v3.5\bin\wix.dll + + + + + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Builder/Builder.csproj.user b/Builder/Builder.csproj.user new file mode 100644 index 0000000..9c8597b --- /dev/null +++ b/Builder/Builder.csproj.user @@ -0,0 +1,17 @@ + + + publish\ + + + + + + + + + + + en-US + false + + \ No newline at end of file diff --git a/Builder/Program.cs b/Builder/Program.cs new file mode 100644 index 0000000..41d6463 --- /dev/null +++ b/Builder/Program.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +//using Microsoft.Tools.WindowsInstallerXml; +//using System.Xml; +using System.Diagnostics; + +namespace Builder { + class Program { + static void Main(string[] args) { + + const string WIXPATH = "C:\\Program Files (x86)\\Windows Installer XML v3\\bin\\"; + + try { + + if(args.Length != 1) throw new ApplicationException("You should specify project name first"); + + string path = args[0]; + if(!Directory.Exists(path)) throw new ApplicationException("Directory doesn't exists"); + string fullPath = new DirectoryInfo(path).FullName; + fullPath += Path.DirectorySeparatorChar; + + string sourceFile = fullPath + "product.wxs"; + if(!File.Exists(sourceFile)) throw new ApplicationException("No wxs file could be found"); + string targetFile = fullPath + "product.wixobj"; + string outputFile = fullPath + "product.msi"; + + ProcessStartInfo candleInfo = new ProcessStartInfo(WIXPATH + "candle.exe", "-nologo -out \"" + targetFile + "\" \"" + sourceFile + "\""); + candleInfo.UseShellExecute = false; + candleInfo.RedirectStandardOutput = true; + Process candle = Process.Start(candleInfo); + //candle.Start(); + candle.WaitForExit(); + Console.Write(candle.StandardOutput.ReadToEnd()); + + ProcessStartInfo lightInfo = new ProcessStartInfo(WIXPATH + "light.exe", "-nologo -out \"" + outputFile + "\" \"" + targetFile + "\""); + lightInfo.UseShellExecute = false; + lightInfo.RedirectStandardOutput = true; + Process light = Process.Start(lightInfo); + //light.Start(); + light.WaitForExit(); + Console.Write(light.StandardOutput.ReadToEnd()); + +/* Preprocessor preprocessor = new Preprocessor(); + preprocessor.CurrentPlatform = Platform.X86; + + XmlDocument sourceDocument = preprocessor.Process(Path.GetFullPath(sourceFile), new System.Collections.Hashtable()); + + Compiler compiler = new Compiler(); + compiler.CurrentPlatform = Platform.X86; + + Intermediate intermediate = compiler.Compile(sourceDocument); + if(intermediate != null) intermediate.Save(targetFile); + + Microsoft.Tools.WindowsInstallerXml.Tools.Light.Main(new string[] { targetFile });*/ + + } catch(ApplicationException e) { + Console.WriteLine("Error: " + e.Message); + } + + } + } +} diff --git a/Builder/Properties/AssemblyInfo.cs b/Builder/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8133a15 --- /dev/null +++ b/Builder/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Builder")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Builder")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7963e6be-281d-4a99-8bd1-91c3f3211aa5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/FLocal.sln b/FLocal.sln index f8b8dad..a525db8 100644 --- a/FLocal.sln +++ b/FLocal.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MySQLConnector", "MySQLConn EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MySql.Data", "ThirdParty\mysql-connector-net-6.2.3\MySql.Data\Provider\MySql.Data.csproj", "{E9DF5ED1-4CBD-4226-B931-9A51610AC14D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Builder", "Builder\Builder.csproj", "{D8D6EFEC-76D7-4870-BD71-C90FA6D7368A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -51,6 +53,12 @@ Global {E9DF5ED1-4CBD-4226-B931-9A51610AC14D}.Release|Any CPU.Build.0 = Release|Any CPU {E9DF5ED1-4CBD-4226-B931-9A51610AC14D}.Release|x86.ActiveCfg = Release|x86 {E9DF5ED1-4CBD-4226-B931-9A51610AC14D}.Release|x86.Build.0 = Release|x86 + {D8D6EFEC-76D7-4870-BD71-C90FA6D7368A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8D6EFEC-76D7-4870-BD71-C90FA6D7368A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8D6EFEC-76D7-4870-BD71-C90FA6D7368A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D8D6EFEC-76D7-4870-BD71-C90FA6D7368A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8D6EFEC-76D7-4870-BD71-C90FA6D7368A}.Release|Any CPU.Build.0 = Release|Any CPU + {D8D6EFEC-76D7-4870-BD71-C90FA6D7368A}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE