One great feature Windows 7 was possibility to install them without needing a key. Instead of entering 25-digit key, you could just select skip and Windows would give you 30 days after install to setup everything before requiring valid product key.
I found this really useful during setup of a new machine when I would have multiple reinstalls while trying out various drivers and performing their troubleshooting. Only once I was perfectly satisfied with machine, I would activate it.
More than once I also used this feature to reproduce a bug in different OS language (e.g. German). Mind you, I did have keys for that particular version (MSDN subscription is a great thing) but I was regularly too lazy to look key up for a version that would essentially get installed and deleted within a day.
Thus I was really pissed off when I found that feature was missing in Windows 8. But I was wrong. Feature is still present in setup. Only now it requires some preparation first.
Very first step is to copy all files from Windows DVD. Assuming that you have your DVD at letter W: and that you want staging directory at C:\Windows81, this would be:
ROBOCOPY W:\ C:\Windows81 /MIR
…
Once copy operation has completed, we need to create ei.cfg in C:\Windows81\sources directory. In my case I wanted to specify Professional edition expecting retail key so I created file with following content:
[EditionID]
Professional
[Channel]
Retail
[VL]
0
Only thing missing is creating new ISO file that we can burn on DVD. While this is not strictly necessary if you are creating bootable USB, I find having pre-prepared image an useful step. If nothing else, it is easier to backup a single ISO file than over a writable USB.
For bootable image creation we need Windows Assessment and Deployment Kit (or Windows ADK) for desired Windows version. Since I wanted to adjust Windows 8.1, I downloaded Windows ADK for Windows 8.1 but Windows 8 ADK is also freely available. Only thing that you really need to install for this guide are Deployment Tools. All other stuff you can uncheck.
To create bootable ISO image, I enter cmd.exe and there execute:
CD "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\x86\Oscdimg"
OSCDIMG.EXE -u1 -bC:\Windows81\boot\etfsboot.com C:\Windows81 D:\Windows81.iso
OSCDIMG 2.56 CD-ROM and DVD-ROM Premastering Utility
Copyright (C) Microsoft, 1993-2012. All rights reserved.
Licensed only for producing Microsoft authorized content.
Scanning source tree (2000 files in 803 directories)
Scanning source tree complete (2094 files in 867 directories)
Computing directory information complete
Image file is 3984359424 bytes
Writing 2094 files in 867 directories to D:\Windows81.iso
100% complete
Final image file is 3990419456 bytes
Done.
This will create bootable Windows81.iso image in a root directory of your second drive. If you have a single drive, place file into a subdirectory. Otherwise file will be written in Virtual store (usually at %USERPROFILE%\AppData\Local\VirtualStore).
Finally we have image that will not ask you for key during install and it will allow you to skip key entry for 30 days. Just burn it to CD or make bootable USB and you are ready to go.
PS: This also means that you can use your Windows 8 key to activate Windows 8.1 after installation is done. While Windows 8 key won’t work during installation, it will work nicely once everything is fully installed.
PPS: If you omit EditionID from ei.cfg, you will get an option to select edition that you would like (Professional or Core).
PPPS: No, this is not a hack. Microsoft has it all documented (both ei.cfg and oscdimg.exe).
I am a big fan of Private Internet Access. It gives you anonymous and secure connection to Internet. I personally value my privacy and thus I find such VPN service very valuable.
Under Windows and huge variety of alternate platforms (Android, iOS, Ubuntu, …) installation is very simple and it hardly ever fails. But some platforms don’t come with instructions. Unfortunately one of them is CentOS. Fortunately, setting it all up is not that hard.
First we can do the easy stuff. Download PIA’s OpenVPN configuration files and extract it to directory of your choice. I kept them in /home/MyUserName/pia.
Next easy step is setting up DNS resolving. For that we go to System, Preferences, Network Connections. Just click edit on connection you are using and go to IPv4 Settings tab. Change Method to Automatic (DHCP addresses only). Under DNS servers enter 209.222.18.222 209.222.18.218 (Private Internet Access DNS).
All other commands are to be executed in terminal and most of them require root privileges. It might be best if you just become root for a while:
su - root
CentOS repositories are not known for their extensive software collection. But we can always add a repository of our choice:
Now we can test our connection (after we restart network in order to activate DNS changes):
service network restart
openvpn --config /etc/openvpn/client.conf
Assuming that this last step ended with Initialization Sequence Completed, we just need to verify whether this connection is actually used. I found whatismyipaddress.com quite helpful here. If you see some mid-west town on map, you are golden (assuming that you don’t actually live in US mid-west).
Now you can stop test connection via Ctrl+C in order to properly start it. In addition, you can specify it should start on each system startup:
When you install CentOS 6.4 in VirtualBox, quite quickly you might be annoyed by a lack of a mouse integration. Usual cure in form of VM guest additions simply fails with
Building the main Guest Additions module [FAILED]
Fortunately this message comes with some additional information which points to lack of compiler and kernel headers. Easiest way to install them is in terminal:
su - root
yum install gcc
yum install kernel-devel-`uname-r`
After this you can retry guest additions installation and you should see better results.
It all started when I wanted to show custom shortcut text next to a menu item on a tray icon’s context menu. Usually this is as easy as setting ShortcutKeyDisplayString property. So I did, and it worked. Sort-of.
For some reason ContextMenuStrip on TrayIcon is not shown on first right-click but only on second. While it is not a major issue, I found it really annoying. That meant that I had to stick to good old ContextMenu and its MenuItem. Unfortunately that also meant that there was no ShortcutKeyDisplayString to help me.
And then I remembered trick from my VB 6 days: anything could be displayed in shortcut position if you would separate it by tab character. So I tried this:
In my previous post we’ve been dealing with TreeView drag&drop. One other functionality that is almost mandatory for TreeView is renaming a node. While basic code is quite straight forward, there are few tricks in order to get better-than-default behavior.
First order of business is BeforeLabelEdit event. There we define which nodes will have fixed name. In our case, we will not allow editing of folder names:
In AfterLabel event we handle everything else. We want new text without spaces on either end and no duplicates are allowed. It complicates code a bit but not by much. Probably only non obvious thing is actual sorting. Here we just “schedule” it after event handler is done with processing:
if(e.Label ==null){return;}//no change was made
e.CancelEdit =true;//we will handle changes manuallystring newText = e.Label.Trim();//no spacesvar nodes =(e.Node.Parent ==null)? tree.Nodes : e.Node.Parent.Nodes;foreach(TreeNode node in nodes){if((node != e.Node)&&string.Equals(newText, node.Text, StringComparison.Ordinal)){return;//duplicate name}}
e.Node.Text = newText;//rename manually
tree.BeginInvoke(new Action<TreeNode>(delegate(TreeNode node){//sort again
tree.Sort();
tree.SelectedNode = node;}), e.Node);
PS: In sample code you will see that I use ImageIndex==0 to determine whether node is of folder type. In real program you would probably go with sub-classing TreeNode.