Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experimental windows setup #421

Merged
merged 1 commit into from
Sep 2, 2020
Merged

experimental windows setup #421

merged 1 commit into from
Sep 2, 2020

Conversation

majastrz
Copy link
Member

@majastrz majastrz commented Sep 1, 2020

Added a windows installer and uninstaller. It copies bicep.exe and bicep.pdb to the user's chosen installation directory and adds that directory to the PATH. Uninstall reverts all changes.

The installer is built using an open-source tool called Inno Setup. VS code uses it for its own Windows setup.

@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2020

Codecov Report

Merging #421 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #421   +/-   ##
=======================================
  Coverage   91.93%   91.93%           
=======================================
  Files         199      199           
  Lines        6708     6708           
=======================================
  Hits         6167     6167           
  Misses        541      541           
Flag Coverage Δ
#dotnet 91.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@majastrz majastrz marked this pull request as ready for review September 1, 2020 21:30
if($modified)
{
$newPath = [string]::Join(';', $paths);
New-ItemProperty -Path $registryPath -Name $environmentVariable -PropertyType ExpandString -Value $newPath -Force | Out-Null;
Copy link
Member

Choose a reason for hiding this comment

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

Does this work without a reboot? I found that updating the reg value didn't work when I wrote the install instructions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Worked on my home machine immediately. The installer does something to make explorer.exe reload environment variables (there's a ChangesEnvironment=yes) setting. What you were probably seeing was explorer.exe launched processes getting stale environment.

Copy link
Member Author

Choose a reason for hiding this comment

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

It will not help with any open command shells (cmd.exe, powershell, etc.) until they are reopened. However, that's a standard behavior for environments. I can make the installer force a reboot, but I don't think it's necessary.

Copy link
Member

Choose a reason for hiding this comment

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

That's fine, no need to force a reboot. The behavior I was seeing was also with newly opened cmd/powershell windows. Sounds like the installer is doing something special to handle it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, explorer or windows must have some sort of API for these situations.

-->
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean the machine has to have .NET 4.6 installed to run the installer?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, it's just a dummy target framework needed for a NoTargets project. The installer is not .net-based btw. I believe it's native code (Delphi I think.)

@@ -0,0 +1 @@
bicep/
Copy link
Member

Choose a reason for hiding this comment

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

I think better to be more precise and prefix with a / (or whatever path prefix you're trying to exclude)

Copy link
Member Author

@majastrz majastrz Sep 2, 2020

Choose a reason for hiding this comment

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

This .gitignore is specific to this directory only, though. I think we did something like that in the VSIX project too.

Copy link
Member

Choose a reason for hiding this comment

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

Unless you need to create bicep folders at different levels it feels unnecessary. It's often done for more general build artifacts like out or node_modules which can appear at different levels, but in this case I think you should know exactly where the folder is created.

@@ -80,6 +84,36 @@ jobs:
with:
flags: dotnet

build-windows-setup:
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be added to the release as well (lower down in this file)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah intentionally left it out until we validate the installer more.

@@ -0,0 +1,49 @@
param (
Copy link
Member

Choose a reason for hiding this comment

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

Would you mind making a note to update the install instructions for Windows when we next have a release? Maybe we can just start another 'running items for 0.2 release' note.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #424

@majastrz majastrz merged commit a49ef65 into master Sep 2, 2020
@majastrz majastrz deleted the majastrz/windows-installer branch September 2, 2020 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants