-
Notifications
You must be signed in to change notification settings - Fork 730
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
// Defines version of MSBuild project SDKs to use | ||
// https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2019#how-project-sdks-are-resolved | ||
"msbuild-sdks": { | ||
"Microsoft.Build.NoTargets": "2.0.1" | ||
}, | ||
"sdk": { | ||
"comment": "Need to use a particular version to ensure consistency across machines no matter what SDK versions they have installed.", | ||
"version": "3.1.301", | ||
"RollForward": "latestFeature" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bicep/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think better to be more precise and prefix with a There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless you need to create |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
param ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created #424 |
||
[Parameter()] | ||
[ValidateNotNullOrEmpty()] | ||
[string] $AppPath, | ||
|
||
[Parameter()] | ||
[bool] | ||
$Remove = $false | ||
) | ||
|
||
$ErrorActionPreference = 'Stop'; | ||
|
||
$registryPath = 'HKCU:\Environment'; | ||
$environmentVariable = 'Path'; | ||
|
||
$environmentKey = Get-Item -path $registryPath; | ||
[string]$currentPath = $environmentKey.GetValue($environmentVariable, '', [Microsoft.Win32.RegistryValueOptions]::DoNotExpandEnvironmentNames); | ||
|
||
$paths = $currentPath.Split(@(';'), [System.StringSplitOptions]::RemoveEmptyEntries); | ||
|
||
if($Remove) | ||
{ | ||
# remove path | ||
if($paths -contains $AppPath) | ||
{ | ||
$paths = $paths | Where-Object { $_ -ne $AppPath }; | ||
$modified = $true; | ||
} | ||
} | ||
else | ||
{ | ||
# upsert path | ||
if(-not ($paths -contains $AppPath)) | ||
{ | ||
$paths += $AppPath; | ||
$modified = $true; | ||
} | ||
} | ||
|
||
if(-not $paths) | ||
{ | ||
$paths = @(); | ||
} | ||
|
||
if($modified) | ||
{ | ||
$newPath = [string]::Join(';', $paths); | ||
New-ItemProperty -Path $registryPath -Name $environmentVariable -PropertyType ExpandString -Value $newPath -Force | Out-Null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#define MyAppName "Bicep CLI" | ||
|
||
#ifndef MyAppVersion | ||
#define MyAppVersion "0.0" | ||
#endif | ||
|
||
#define MyAppPublisher "Microsoft Corporation" | ||
#define MyAppURL "https://github.com/Azure/bicep" | ||
#define MyAppExeName "bicep.exe" | ||
|
||
[Setup] | ||
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. | ||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) | ||
AppId={{7EF9DE63-59B1-4325-955A-937F3E0A4EA8} | ||
AppName={#MyAppName} | ||
AppVersion={#MyAppVersion} | ||
;AppVerName={#MyAppName} {#MyAppVersion} | ||
AppPublisher={#MyAppPublisher} | ||
AppPublisherURL={#MyAppURL} | ||
AppSupportURL={#MyAppURL} | ||
AppUpdatesURL={#MyAppURL} | ||
DefaultDirName={autopf}\{#MyAppName} | ||
DefaultGroupName={#MyAppName} | ||
LicenseFile=..\..\LICENSE | ||
PrivilegesRequired=lowest | ||
OutputBaseFilename=bicep-setup-win-x64 | ||
Compression=lzma | ||
SolidCompression=yes | ||
WizardStyle=modern | ||
ChangesEnvironment=yes | ||
|
||
[Languages] | ||
Name: "english"; MessagesFile: "compiler:Default.isl" | ||
|
||
[Files] | ||
Source: "bicep\bicep.exe"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "bicep\bicep.pdb"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "SetPath.ps1"; DestDir: "{app}\setup"; Flags: ignoreversion | ||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files | ||
|
||
[Run] | ||
Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -Command ""& '{app}\setup\SetPath.ps1' -AppPath '{app}' -Remove $false"" "; WorkingDir: {app}; Flags: runhidden | ||
|
||
[UninstallRun] | ||
Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -Command ""& '{app}\setup\SetPath.ps1' -AppPath '{app}' -Remove $true"" "; WorkingDir: {app}; Flags: runhidden |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- | ||
This project pulls down the setup compiler from a nuget and invokes it to build the setup exe. | ||
It depends on the published self-contained bicep.exe and bicep.pdb to be placed in a bicep subfolder. | ||
During the CI build, this happens via artifact download action. | ||
--> | ||
<Project Sdk="Microsoft.Build.NoTargets"> | ||
<PropertyGroup> | ||
<TargetFramework>net46</TargetFramework> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.) |
||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Tools.InnoSetup" Version="6.0.5" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<IssFile Include="bicep.iss" /> | ||
</ItemGroup> | ||
|
||
<Target Name="RunTool" AfterTargets="Build" DependsOnTargets="GetBuildVersion"> | ||
<Exec Command="$(InnoSetupCompiler) %(IssFile.FullPath) /O$(OutDir) /DMyAppVersion=$(BuildVersion)" /> | ||
</Target> | ||
</Project> |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.