Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0fb47d4
Addin Installer Telemetry
sanyamc-msft Aug 19, 2015
785acc2
InstallerTelemetry2
sanyamc-msft Aug 22, 2015
2cda404
Removing older files
sanyamc-msft Aug 22, 2015
99a5f49
adding indentation
sanyamc-msft Aug 24, 2015
9d75c29
Removing tabs from Buildrelease.ps1
sanyamc-msft Aug 24, 2015
a4cba5d
Addressing PR feedback
sanyamc-msft Aug 25, 2015
06f51e2
Added final feedback
sanyamc-msft Aug 26, 2015
77de181
using default wix targets
sanyamc-msft Aug 26, 2015
ef73165
Adding build.targets
sanyamc-msft Aug 26, 2015
7b3b336
Adding Build.targets
sanyamc-msft Aug 26, 2015
82500a5
Reverting build.targets changes as my dlls are projects and not dlls …
sanyamc-msft Aug 26, 2015
32ff627
Adding feedback
sanyamc-msft Aug 26, 2015
4931fe4
Adding feedback from CR
sanyamc-msft Aug 26, 2015
f1e4aae
Merge pull request #381 from nareshjo/telemetry
mousetraps Aug 26, 2015
3c6a345
Using Checked in wix.ca.targets
sanyamc-msft Aug 26, 2015
190322c
Removing assemblyversions.cs
sanyamc-msft Aug 26, 2015
5a093e5
Fixing releasebuild variable and adding csharp target to build .ca.dl…
sanyamc-msft Aug 27, 2015
ca896ec
Adding default AssemblyVersion.cs
sanyamc-msft Aug 27, 2015
34a9c26
Addin Installer Telemetry
sanyamc-msft Aug 19, 2015
d1b4d20
InstallerTelemetry2
sanyamc-msft Aug 22, 2015
b5c4e10
Removing older files
sanyamc-msft Aug 22, 2015
a722233
adding indentation
sanyamc-msft Aug 24, 2015
963acce
Removing tabs from Buildrelease.ps1
sanyamc-msft Aug 24, 2015
82518c9
Addressing PR feedback
sanyamc-msft Aug 25, 2015
135fca0
Added final feedback
sanyamc-msft Aug 26, 2015
8d23423
using default wix targets
sanyamc-msft Aug 26, 2015
7974ad4
Adding build.targets
sanyamc-msft Aug 26, 2015
0a848ce
Reverting build.targets changes as my dlls are projects and not dlls …
sanyamc-msft Aug 26, 2015
8d88318
Adding feedback from CR
sanyamc-msft Aug 26, 2015
7f6c793
Using Checked in wix.ca.targets
sanyamc-msft Aug 26, 2015
3003c20
Fixing releasebuild variable and adding csharp target to build .ca.dl…
sanyamc-msft Aug 27, 2015
7ea8a49
Updating with latest changes from master
sanyamc-msft Aug 27, 2015
a6bfc96
Merging files
sanyamc-msft Aug 27, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding feedback from CR
  • Loading branch information
sanyamc-msft committed Aug 26, 2015
commit 4931fe40caf386d5482529726f4c9b3b4ff829c3
69 changes: 37 additions & 32 deletions Nodejs/Setup/InstallerTelemetryAction/InstallerTelemetryAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,47 @@
namespace Microsoft.NodejsTools.Telemetry
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Braces on same line here and everywhere else.

public class InstallerTelemetryActions {
private static void LogInstallStatus(string InstallStatus,Session session) {

[CustomAction]
public static ActionResult RecordInstallStartTime(Session session) {
session["InstallStartTime"] = DateTime.Now.ToString(CultureInfo.InvariantCulture);
return ActionResult.Success;
}

[CustomAction]
public static ActionResult LogInstallSuccessResult(Session session) {
session.Log("Begin Telemetry Log");
LogInstallStatus("Success", session);
session.Log("End Telemetry Log");
return ActionResult.Success;
}

[CustomAction]
public static ActionResult LogInstallErrorResult(Session session) {
session.Log("Begin Telemetry Log");
LogInstallStatus("Error", session);
session.Log("End Telemetry Log");
return ActionResult.Success;
}

[CustomAction]
public static ActionResult LogInstallCancelResult(Session session) {
session.Log("Begin Telemetry Log");
LogInstallStatus("Cancel", session);
session.Log("End Telemetry Log");
return ActionResult.Success;
}

private static void LogInstallStatus(string InstallStatus, Session session)
{
TimeSpan installTime = DateTime.Now - DateTime.Parse(session["InstallStartTime"]);
bool isInstalled = session.EvaluateCondition("Installed");
string currentState = null;
string requestState = null;

FeatureInfoCollection featureInfoCollection = session.Features;
foreach (FeatureInfo featureInfo in featureInfoCollection) {
foreach (FeatureInfo featureInfo in featureInfoCollection)
{
currentState = featureInfo.CurrentState.ToString("F");
requestState = featureInfo.RequestState.ToString("F");
// we just want the current and requested state of A feature to understand if its a new user, upgrade, reinstall or remove.
Expand Down Expand Up @@ -85,40 +118,12 @@ private static void LogInstallStatus(string InstallStatus,Session session) {
}
};
string jsonString = (new JavaScriptSerializer()).Serialize(data);
using (WebClient client = new WebClient()) {
using (WebClient client = new WebClient())
{
string response = client.UploadString("https://dc.services.visualstudio.com/v2/track", jsonString);
session.Log(response);
}
}

[CustomAction]
public static ActionResult RecordInstallStartTime(Session session) {
session["InstallStartTime"] = DateTime.Now.ToString(CultureInfo.InvariantCulture);
return ActionResult.Success;
}

[CustomAction]
public static ActionResult LogInstallSuccessResult(Session session) {
session.Log("Begin Telemetry Log");
LogInstallStatus("Success", session);
session.Log("End Telemetry Log");
return ActionResult.Success;
}

[CustomAction]
public static ActionResult LogInstallErrorResult(Session session) {
session.Log("Begin Telemetry Log");
LogInstallStatus("Error", session);
session.Log("End Telemetry Log");
return ActionResult.Success;
}

[CustomAction]
public static ActionResult LogInstallCancelResult(Session session) {
session.Log("Begin Telemetry Log");
LogInstallStatus("Cancel", session);
session.Log("End Telemetry Log");
return ActionResult.Success;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<Content Include="NodejsToolsInstallerVars.wxi" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\InstallerTelemetryAction\InstallerTelemetryAction.csproj" Condition="'$(ReleaseBuild)' == 'True'">
<ProjectReference Include="..\InstallerTelemetryAction\InstallerTelemetryAction.csproj" Condition="'$(ReleaseBuild)' != ''">
<Name>InstallerTelemetryAction</Name>
<Project>{775e686d-c646-4dab-9dcf-d2c37ff8ea78}</Project>
</ProjectReference>
Expand Down
4 changes: 2 additions & 2 deletions Nodejs/Setup/NodejsToolsInstaller/NodejsToolsInstaller.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<CustomAction Id="VWDExpressSetup" Property="VWDEXPRESS_PATH" ExeCommand="/setup" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="VWDExpressSetup_Rollback" Property="VWDEXPRESS_PATH" ExeCommand="/setup" Execute="rollback" Return="check" Impersonate="no" />

<?if "$(var.ReleaseBuild)" = "True" ?>
<?if "$(var.ReleaseBuild)" ~= "" ?>
<Binary Id="InstallerTelemetryAction.CA.dll" SourceFile="..\..\..\BuildOutput\$(var.Configuration)$(var.VSTargetVersion)\Setup\Microsoft.NodejsTools.InstallerTelemetryAction.CA.dll" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$(BuildOutputRoot) should already be defined here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave me build error when I tried using above and $(var.BuildOutputRoot)....keeping it as it is?


<!-- Custom Action for installer telemetry-->
Expand All @@ -173,7 +173,7 @@
<Custom Action="DevEnvSetup" Before="InstallFinalize" Overridable="yes">NOT SKIP_DEVENV_SETUP AND DEVENV_PATH</Custom>
<Custom Action="VWDExpressSetup_Rollback" Before="VWDExpressSetup" Overridable="yes">NOT SKIP_DEVENV_SETUP AND VWDEXPRESS_PATH</Custom>
<Custom Action="VWDExpressSetup" Before="InstallFinalize" Overridable="yes">NOT SKIP_DEVENV_SETUP AND VWDEXPRESS_PATH</Custom>
<?if "$(var.ReleaseBuild)" = "True" ?>
<?if "$(var.ReleaseBuild)" ~= "" ?>
<Custom Action="LogStart" Before="CostFinalize"/>
<Custom Action="LogSuccess" OnExit="success"/>
<Custom Action="LogFailure" OnExit="error" />
Expand Down
4 changes: 2 additions & 2 deletions Nodejs/Setup/setup.proj
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<ProjectFile Include="Profiling\Profiling.wixproj"/>
<ProjectFile Include="NodejsTools\NodejsTools.wixproj"/>
<ProjectFile Include="NodejsToolsInstaller\NodejsToolsInstaller.wixproj"/>
<ProjectFile Include="..\..\Internal\Nodejs\VsLoggerSetup\VsLogger.wixproj" Condition="'$(IncludeVsLogger)' == 'True'"/>
<ProjectFile Include="InstallerTelemetryAction\InstallerTelemetryAction.csproj" Condition="'$(ReleaseBuild)' == 'True'" />
<ProjectFile Include="..\..\Internal\Nodejs\VsLoggerSetup\VsLogger.wixproj" Condition="'$(IncludeVsLogger)' == 'True'"/>
<ProjectFile Include="InstallerTelemetryAction\InstallerTelemetryAction.csproj" Condition="'$(ReleaseBuild)' != ''" />
</ItemGroup>

<Import Project="$(TargetsPath)\Common.Build.Traversal.targets" />
Expand Down