0 Comments

Inspiration

Today my DotNet Pretty articles were featured on @coding4fun by Greg Duncan and one of the comments by Niner bc3tech (@bc3tech) requested that I share this solution on Chocolatey. I decided that this was a good idea and decided to share my experience Smile.

Creating a Chocolatey Account

Creating the Chocolatey account was as simple as filling a couple of common fields at https://chocolatey.org/account/Register.

2014-10-27_18-28-35

In the registration mail you are given a link to Rules to be observed before publishing packages which mentions that you can host your packages with MyGet

2014-10-27_18-34-55

Creating a MyGet Account

Heading over to MyGet I saw that they had a Free subscription

2014-10-27_18-37-06

But they also have an offer for MVP's, ASPInsiders, Windows Azure Insiders and ALM Rangers Smile. Fitting into 2 of these categories now I decided to head over to https://www.myget.org/mvp and request a NFR license Open-mouthed smile. The extra features available on this subscription made it perfect for my community project (and ones to follow Smile). In no time I had my DotNet Pretty Package Feed up.

MyGet Build Services

The DotNet Pretty project is currently hosted out on GitHub and so I decided that I'll try out MyGet's build services which is now in preview. This was as simple as clicking on BUILD SERVICES from the menu and then on Add build sources and then from GitHub.

2014-10-27_18-47-01

this poped open the Link build source dialog where I selected the DotNet Pretty project from the list and clicked Add.

2014-10-27_18-48-37

From here I clicked Build and in no time the build completed

2014-10-27_18-52-16

2014-10-27_18-54-50 and I had a package hosted in MyGet

 

2014-10-27_18-55-56

Updating GitHub project to show MyGet build status

From the build services page I was able to click on copy markdown

2014-10-27_18-58-09

which gave me the markdown that I could insert into the readme.md file which I did with my new favorite Markdown editor MarkdownPad 2

2014-10-27_18-59-29

A quick commit added this status to the public project on GitHub

2014-10-27_19-02-04

Pushing the packaged to Chocolatey

The next thing I needed to do was add a new package source to my MyGet package feed Chocolatey. I went over to the Package Sources menu and clicked on Add package source and the NuGet feed.

2014-10-27_19-24-12

The next bit was very simple, I simple clicked on Presets and then Chocolatey

2014-10-27_19-25-49

This then went ahead and filled in the Name and Source for me

2014-10-27_19-26-42

All that was left to do was provide my Chocolatey which was my Username, Password and API Key. I also filled in some of the extra meta data for my source

2014-10-27_19-29-39

Next I headed over to build services again and clicked on Push upstream

2014-10-27_19-30-34

this presented a window like below

2014-10-27_19-32-34

where I just clicked on Push

2014-10-27_19-33-11

And received the message saying they on it Open-mouthed smile. Headed back over to Chocolatey and my package was in the list

2014-10-27_19-34-27

Installing Chocolatey "Client"

On the machine I'm using I didn't have Chocolatey installed so opened up a PowerShell Command Window as Administrator (just for in case Smile) and ran the command

iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

Installing my package

To test if my package was installer I ran the command below

choco install DotNetPretty -Pre 

which confirmed that my package now now been installed

2014-10-27_19-39-35

At this point my Chocolatey package "installs" by dropping the package contents in the Chocolatey folder

2014-10-27_19-46-252014-10-27_19-47-17

In a later post I will share how to configure the installation logic for a Chocolatey script.

Update: The post can be found here (Configuring a Chocolatey Install).

0 Comments

So yesterday I posted Pushing a new project to Chocolatey and I said I would create another post showing how to configure how the Chocolatey install runs and this is that post Smile with tongue out.

ChocolateyInstall.ps1

The first (only really) step to do this is creating a ChocolateyInstall.ps1 script. From looking at other packages I saw that there was a file like this in a tools folder so I created one for myself in my DotNet Pretty project

2014-10-28_08-18-26

and set the Build Action to Content and Copy to Output Directory to Copy Always

2014-10-28_08-18-52

The contents of the script was as below

[string]$ScriptDir = Split-Path $MyInvocation.MyCommand.Path -Parent
[string]$copyTo = "$([System.Environment]::GetFolderPath("mydocuments"))\Visual Studio 2013\Visualizers"
[string]$mainAssemblyPath = "$ScriptDir\..\..\lib\net45\*.*"
[string]$binDependenciesAssemblyPath = "$ScriptDir\..\binDependencies\*.*"
if (!(Test-Path -LiteralPath $copyTo))
{
New-Item -Path $copyTo -ItemType directory
}
Copy-Item -Path "$mainAssemblyPath" -Destination "$copyTo" -Force
Copy-Item -Path "$binDependenciesAssemblyPath" -Destination "$copyTo" -Force

Basically doing the exact same thing as what I was doing with the DEBUG post build event in the project settings

I checked that in (over a couple of commits because I didn't get it right the first time Smile with tongue out). MyGet picked up the new commit and performed a build for me. Instead of waiting for my hourly push of packages to Chocolatey from MyGet I just pushed the package as I did in the previous post. I then ran the Chocolatey install for my package

choco install dotnetpretty -pre

and then navigated to the Visualizers folder and my new assemblies were there Smile

2014-10-28_08-24-11 

If you have any feedback or a better way to perform this install do let me know Open-mouthed smile

1 Comments

So you shouldn't need to do this but in my case for some reason I needed to activate windows after performing and upgrade from Windows 8.1.

In my case I tried activating Windows by clicking on Activate Online and that didn't work for me. I managed to activate Windows 10 by entering the product key for enterprise.

image

Windows 10 Pro Key: NKJFK-GPHP7-G8C3J-P6JXR-HQRJR

Windows 10 Enterprise Key: PBHCJ-Q2NYD-2PX34-T2TD6-233PK

You can download bat files that set the key from my GitHub gists using the links below

Activate Pro Gist: http://31og.com/gist/fc85f772fbc35c470f7d

Activate Enterprise Gisthttp://31og.com/gist/b49470b9ba1cf861d56c 

You should be able to find these on the preview site as well. Hopefully this is useful for someone else as well Smile

0 Comments

In windows 10 when you go to Change the background and colors on Start

2014-10-06_08-32-15

it loads up the Color and Appearance window

Color_and_Appearance_2014-10-06_08-33-22

which does let you change the accent and background color for windows. So you stuck with that weird purple looking theme or I managed to get blue type color on one of my machines. After a quick Bing I found that you can just set 2 registry entries restart your pc and you now have theme color that you want Smile.

Basically you need a registry file with the contents below (save that into a .reg file), set the hex values for your color and then run it.

   1: Windows Registry Editor Version 5.00
   2:  
   3: [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization]
   4: "PersonalColors_Accent"="#00b8ff"
   5: "PersonalColors_Background"="#000000"

You can also download this reg file from GutHub using https://github.com/Gordon-Beeming/ChangeWindowsTheme/blob/master/Downloads/set-theme-colors.reg and you can download an app that takes in the 2 hex values and then set it, you will need to run the app as administrator otherwise it will crash. https://github.com/Gordon-Beeming/ChangeWindowsTheme/blob/master/Downloads/ChangeWindowsTheme.exe

Change_Windows_Theme_Color_2014-10-06_09-02-48

The app lets you preview the theme before setting it because you will need to restart after editing the registry to see the changes

0 Comments

I need a VSO account for Demos which needs to be separate from my personal and business VSO accounts. The problem is though if you go to the Visual Studio Online page and click Get started for free

2014-09-26_16-50-38

and then sign in with your existing account details you are directed to your VSO profile page that shows all your VSO accounts.

2014-09-26_16-55-47

So what do you do?

The first thing you are going to need to do is create another Microsoft Account (Live ID). At this point I'd recommend starting a new In-Private browsing session so that you aren't automatically logged into services. Head over to https://account.live.com/ and create a new Microsoft Account or you can head directly to http://www.visualstudio.com/ and create a Microsoft Account as part of your VSO Account creation.

I created my Microsoft Account before continuing to create my VSO account.

Creating a new VSO Account

Go to http://www.visualstudio.com/ and click on the Get started for free button. Enter an account name and click Create Account.

2014-09-26_17-09-41

You now have a new VSO account Smile.

Adding a new User to your VSO Account

From the new accounts landing page which should look like below

2014-09-26_17-12-13

Click on the Users tab in the main navigation

2014-09-26_17-14-26

Enter your primary VSO account Sign-in address (that you want to link this account to) and choose the License that this user must get and then click Send Invitation.

2014-09-26_17-15-27

At this point you will be able to log into the new VSO account with your primary VSO account.

Switching your VSO account Ownership

The last thing we need to do is switch the ownership of our new VSO account. Ideally for most Demos you would want to be the owner of the VSO account. To change the owner of a VSO account click on the Settings icon in the top right

2014-09-26_17-13-06

Then click on the Settings tab

2014-09-26_17-13-46

Choose the owner account (your primary VSO account for this example) and click Save.

2014-09-26_17-20-22

Deleting a user from VSO

At this point you'd be able to delete the user from the demo account that you used to create the account with. You might want to do this if you for one need to use your 5 basic users free accounts for other demo users or if you want to repeat the steps in this post and don't want to create another Microsoft Account to do it with. To delete the user your create simply select them in the users screen and then click Delete.

2014-09-26_17-23-07

You'll be asked if you are sure, click Delete User.

2014-09-26_17-25-18

You now have a new VSO account linked to your primary Microsoft Account so you don't have to use different sign-in accounts for demos and your other VSO accounts that you may be apart of Smile