aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-25 16:03:14 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-25 16:03:14 +0200
commit08d9858ecd0d4adb0c9c6076d7d2b1216e8f64c3 (patch)
treeb1f11d302b4db5346213b7c93c78d4b9500d8398 /Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller
parent602f49b2b0eb1f032f3dead60e8bf499ceca0a7b (diff)
downloadTango-08d9858ecd0d4adb0c9c6076d7d2b1216e8f64c3.tar.gz
Tango-08d9858ecd0d4adb0c9c6076d7d2b1216e8f64c3.zip
Completed advanced installer lib + unit test.
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller')
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/AdvancedInstaller_TST.cs43
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/cacheIndex.txtbin0 -> 52 bytes
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/disk1.cabbin0 -> 147 bytes
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/output-info.inibin0 -> 1470 bytes
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject.aip8
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/Setup Files/DemoProject.msibin0 -> 518656 bytes
6 files changed, 38 insertions, 13 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
new file mode 100644
index 000000000..5fe5afe5a
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/cacheIndex.txt
Binary files differ
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
new file mode 100644
index 000000000..c376f83d7
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/disk1.cab
Binary files differ
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
new file mode 100644
index 000000000..3586cb103
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/DemoProject-cache/part1/output-info.ini
Binary files differ
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
new file mode 100644
index 000000000..9803733dc
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/AdvancedInstaller/DemoProject/Setup Files/DemoProject.msi
Binary files differ