Skip to content

Commit

Permalink
fix: Unable to intstall new version
Browse files Browse the repository at this point in the history
There are few issues with the install script related to configuring
the telemetry settings.

1. On W7 there is only PowerShell 2.0 (that is what ships with .NET 2.0).
On the later versions of OS there are different versions of PowerShell and
thus requiring a specific version would lead to failures.

2. A problem related to the logic responsible for self-removal

  * First `$MyINvocation.InvocationName` returned different and unexpected
    values when a script is run not from a command line but invoked as a
    script-block. In the latter case, `$MyINvocation.InvocationName` is
    set to `&`.

  * Secondly the installer somehow would fail to remove the script
    (permissions?)

The self-removal logic is removed.

Also bumping the version to 3.2.1 to ensure the new fix flows through
to all distribution channels correctly.

Resolves gitextensions#7120

(cherry picked from commit cedb588)

# Conflicts:
#	appveyor.yml
  • Loading branch information
RussKie authored and mast-eu committed Oct 15, 2019
1 parent 0761740 commit 17e9d82
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions Bin/set-telemetry.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,3 @@ $node = $doc.CreateElement('item');
$node.InnerXml = "<key><string>TelemetryEnabled</string></key><value><string>$telemetryEnabled</string></value>";
$_ = $topNode.AppendChild($node);
$doc.Save($userAppDataPath)

# this script now deletes itself
Remove-Item $MyINvocation.InvocationName
3 changes: 1 addition & 2 deletions Setup/UI/TelemetryDlg.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
<![CDATA[Installed OR POWERSHELLEXE]]>
</Condition>

<!-- Windows 7SP1 supports only PowerShell 2.0 -->
<SetProperty Id="ConfigureTelemetry"
Before ="ConfigureTelemetry"
Sequence="execute"
Value="&quot;[POWERSHELLEXE]&quot; -Version 2.0 -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy Bypass -Command &quot;&amp; '[INSTALLDIR]set-telemetry.ps1' [TELEMETRY_ENABLED] ; exit $$($Error.Count)&quot;" />
Value="&quot;[POWERSHELLEXE]&quot; -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy Bypass -Command &quot;&amp; '[INSTALLDIR]set-telemetry.ps1' [TELEMETRY_ENABLED]; exit $$($Error.Count)&quot;" />

<CustomAction Id="ConfigureTelemetry" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="yes" />

Expand Down

0 comments on commit 17e9d82

Please sign in to comment.