diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
7 files changed, 40 insertions, 15 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/AdvancedInstaller_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/AdvancedInstaller_TST.cs index 60a047c0c..b883db7b7 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/AdvancedInstaller_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/AdvancedInstaller_TST.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using Tango.AdvancedInstaller; using Tango.Core.IO; @@ -16,30 +17,52 @@ namespace Tango.UnitTesting.AdvancedInstaller public class AdvancedInstaller_TST { [TestMethod] - public void Set_Version_and_Package_name_And_Build() + public void Build_Install_Verify() { - InstallerBuilder builder = new InstallerBuilder(); - var demo_project_path = Directory.GetCurrentDirectory() + "\\AdvancedInstaller\\DemoProject"; var project_Path = Path.Combine(demo_project_path, "DemoProject.aip"); var files_path = Path.Combine(demo_project_path, "Files"); var added_file = files_path + "\\addedFile.txt"; + InstallerBuilder builder = new InstallerBuilder(project_Path); + File.WriteAllText(added_file, "Added File!"); var output_folder = TemporaryManager.Default.CreateFolder(); - builder.ProjectFile = project_Path; - builder.OutputFolder = output_folder; - builder.ProductName = "TEST TEST TEST"; - builder.ProductVersion = "2.0.0.0"; - builder.PackageType = PackageType.MSI; + String product_name = builder.GetProperty(ProjectProperty.ProductName).Result; + String manufacturer = builder.GetProperty(ProjectProperty.Manufacturer).Result; - builder.Build().Wait(); + var output_file = output_folder + "\\" + product_name + " Installer_v2.0.0.msi"; + + builder.Build("2.0.0", output_file).Wait(); File.Delete(added_file); - output_folder.Display(); + Assert.IsTrue(File.Exists(output_file)); + + var process = Process.Start(output_file); + process.WaitForExit(); + + File.Delete(output_file); + + String installationFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), manufacturer, product_name); + + Assert.IsTrue(File.Exists(Path.Combine(installationFolder, Path.GetFileName(added_file)))); + + Thread.Sleep(2000); + + bool installed = builder.IsInstalled().Result; + + Assert.IsTrue(installed); + + builder.Uninstall().Wait(); + + Thread.Sleep(2000); + + installed = builder.IsInstalled().Result; + + Assert.IsFalse(installed); } } } diff --git a/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/cacheIndex.txt b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/cacheIndex.txt Binary files differnew file mode 100644 index 000000000..5fe5afe5a --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/cacheIndex.txt diff --git a/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/disk1.cab b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/disk1.cab Binary files differnew file mode 100644 index 000000000..c376f83d7 --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/disk1.cab diff --git a/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/output-info.ini b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/output-info.ini Binary files differnew file mode 100644 index 000000000..3586cb103 --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/output-info.ini diff --git a/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject.aip b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject.aip index a4889c4c0..10abc0933 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject.aip +++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject.aip @@ -5,8 +5,10 @@ </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent"> <ROW Property="AI_BITMAP_DISPLAY_MODE" Value="0"/> - <ROW Property="ALLUSERS" Value="1"/> + <ROW Property="ALLUSERS" Value="1" MultiBuildValue="DefaultBuild:"/> <ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/> + <ROW Property="ARPNOMODIFY" MultiBuildValue="DefaultBuild:1"/> + <ROW Property="LIMITUI" MultiBuildValue="DefaultBuild:1"/> <ROW Property="Manufacturer" Value="Twine"/> <ROW Property="ProductCode" Value="1033:{C26BE216-84DB-452A-BA46-F927A7F87F39} " Type="16"/> <ROW Property="ProductLanguage" Value="1033"/> @@ -101,7 +103,7 @@ <ROW Action="AI_ResolveKnownFolders" Type="1" Source="aicustact.dll" Target="AI_ResolveKnownFolders"/> <ROW Action="AI_SHOW_LOG" Type="65" Source="aicustact.dll" Target="LaunchLogFile" WithoutSeq="true"/> <ROW Action="AI_STORE_LOCATION" Type="51" Source="ARPINSTALLLOCATION" Target="[APPDIR]"/> - <ROW Action="SET_APPDIR" Type="307" Source="APPDIR" Target="[ProgramFilesFolder][Manufacturer]\[ProductName]"/> + <ROW Action="SET_APPDIR" Type="307" Source="APPDIR" Target="[ProgramFilesFolder][Manufacturer]\[ProductName]" MultiBuildTarget="DefaultBuild:[AppDataFolder][Manufacturer]\[ProductName]"/> <ROW Action="SET_SHORTCUTDIR" Type="307" Source="SHORTCUTDIR" Target="[ProgramMenuFolder][ProductName]"/> <ROW Action="SET_TARGETDIR_TO_APPDIR" Type="51" Source="TARGETDIR" Target="[APPDIR]"/> </COMPONENT> @@ -137,6 +139,6 @@ <ROW UpgradeCode="[|UpgradeCode]" VersionMin="[|ProductVersion]" Attributes="2" ActionProperty="AI_NEWERPRODUCTFOUND"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.SynchronizedFolderComponent"> - <ROW Directory_="APPDIR" SourcePath="Files" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6"/> + <ROW Directory_="APPDIR" SourcePath="Files" Feature="MainFeature" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6"/> </COMPONENT> </DOCUMENT> diff --git a/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/Setup Files/DemoProject.msi b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/Setup Files/DemoProject.msi Binary files differnew file mode 100644 index 000000000..9803733dc --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/Setup Files/DemoProject.msi diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index 357a2344b..4e852fed8 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -118,7 +118,7 @@ </ItemGroup> <ItemGroup> <Content Include="AdvancedInstaller\DemoProject\DemoProject.aip"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <None Include="App.config" /> <None Include="packages.config" /> @@ -242,7 +242,7 @@ <Import Project="..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
