Showing posts with label ESD. Show all posts
Showing posts with label ESD. Show all posts

2007-04-16

Delphi 2007: Putting a "fat cow" on a diet...

First, for those who don't understand the title, it's a small joke to another blog post which has since been renamed...

In this post, I'll explain to all those hackers around how to install the Delphi 2007 ESD while preserving 2.6 GB of your C: drive. You will require 1.2 GB on another partition, but if you're like me, you'll have those around! :) Still, your total will be 2.2 GB versus the default 3.6 GB and you'll loose nothing important (other than redundantly cached install files and needless .NET help...)

I like to keep my C: drive as lean as possible so as to be viable to make a compressed GHOST image of it and still fit a fully installed and configured working environment on a DVD. This way, I can restore my system to a working condition in around 10 minutes. However, the default way of installing Delphi 2007 simply uses 3.6 GB of C: space! So, I needed to come up with something different. CodeGear is supposedly working on a better install, although it's now a whole month since Delphi 2007 is out and that new installer is yet to be seen, and, even worse, due to SOX, they won't commit on a date for when that's coming out...

So, let me describe this process, which I must say I haven't tested on Vista as I don't use that... It does however work very well in decent versions of Windows such as XP, 2000 or 2003.

There are two main goals that I want to achieve here:
1) Setting up Delphi 2007 while simultaneously keeping it from caching stuff on C:;
2) Improve the help by not returning .NET results and, again, shave some few more MBs from C:.
This 2nd part should only be followed by those not requiring the .NET help for another dev tool, that is, for all those that like myself couldn't care less of .NET and only develop "for Win32".

Step 1: Download the following 3 prerequesites:

1) Microsoft .NET Framework Version 2.0 Redistributable Package (x86)

2) Microsoft Visual J# Version 2.0 Redistributable Package

3) .NET Framework 2.0 Software Development Kit (SDK) (x86)

You should now have the following 3 EXE files:
setup.exe
dotnetfx.exe
vjredist.exe

Step 2: "pre-process" those files.

Using WinZip, 7-Zip or your favorite archiving tool, uncompress all those 3 files (yes, they're self-extracting .ZIP files but we want some control!). Extract the contents of each file onto it's own folder.

You should now have the following 3 folders:

setup
dotnetfx
vjredist

Rename "setup" to a more descriptive "dotnetsdk".

You should save them somewhere where you can access them later, should you want to modify the installations. In this example, we'll be using D:\Install, so move them all over there.

Step 3: Installing the prerequesites.

1) Run "D:\Install\dotnetfx\install.exe"
2) Run "D:\Install\vjredist\install.exe"
3) Run "D:\Install\dotnetsdk\install.exe"
In this last one, select only "Product Documentation": the other two options are not needed.

Q: Why did we uncompress these and "manually" run the MSIs?
A: We're doing this to save you 400 MB of C: space in exchange of a couple minutes of your time!

Q: And how are we saving space?
A: That's what we'll do next!

Step 4: Saving 400 MB of cached files in C:, while still not breaking anything...

Installing those 3 products cached the install files on C:. We will now update the registry to point to the same files in D:\Install, so as to allow you to Remove/Repair apply any security update on any of those products...
Using RegEdit, change the following values:

Start by navigating to here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\
Key.....: 5B868AEEE5852414A85EBF681240D704
Value...: D6461317C3DC4F04799BDCE9E42626FE
Old Data: C:\WINDOWS\Microsoft.NET\...\netfx.msi
Set To..: D:\Install\dotnetfx\netfx.msi

Key.....: 521E4F6057E22F94ABD31D61977E7BAD
Value...: 2C951936B72B802498568D0AEABDED2D
Old Data: C:\Program Files\...\netfxsdk.msi
Set To..: D:\Install\dotnetsdk\netfxsdk.msi

Key.....: EF03A325B58ACCF46AD453FC5B8D3A6D
Value...: 2C951936B72B802498568D0AEABDED2D
Old Data: C:\Program Files\...\netfxsd1.cab
Set To..: D:\Install\dotnetsdk\netfxsd1.cab

Key.....: AAC54F5B3FA6B6B45864A1DA921F3C4C
Value...: 34053A86A55C7324889C73EEC136DE17
Old Data: C:\WINDOWS\Microsoft.NET\...\jsredist.msi
Set To..: D:\Install\vjredist\jsredist.msi

Key.....: 0DFA9869D465FA14CAFF90CB479360E9
Value...: 34053A86A55C7324889C73EEC136DE17
Old Data: C:\WINDOWS\Microsoft.NET\...\jsredis1.cab
Set To..: D:\Install\vjredist\jsredis1.cab
You can also delete (but it's not required) the following key:
HKEY_CLASSES_ROOT\Installer\Products\D6461317C3DC4F04799BDCE9E42626FE\SourceList\Net\2
Since the 1st one is set to the correct path, this "2" will be ignored anyway.

By now, you've just lost 1.079 MB. Yep! That's 1 GB of .NET prereqs for a "for Win32" product! :)

Don't worry, we'll shave some of that now!

Step 4b: "Safe" shaving...

You can now delete the following folders as they're no longer required:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft .NET Framework 2.0"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft Visual J# 2.0 Redistributable Package"
"C:\Program Files\Microsoft Visual Studio 8\Microsoft .NET Framework 2.0 SDK - ENU"

We have now cut down our losses to "only" 685.4 MB...

Step 4c: ".NET Help" shaving: only do this if you don't require .NET help in any development application:
(If in doubt, make a backup of those files elsewhere so as to undo it later...)

Delete the following folder:
"C:\Program Files\Microsoft.NET\SDK\v2.0\Docs\1033"

Delete all files starting with "MS.NETFramework.v20." in this folder:
"C:\Documents and Settings\All Users\Application Data\Microsoft Help"

We have now cut our losses to only 324.8 MB and simultaneously prevented Delphi 2007 from showing unappropriated .NET help...


If you have the time, there's a couple hundred registry references to all those files/folders we deleted above: I haven't bothered with deleting/changing them all and all seems to be working just fine. Maybe if one of these days I find myself some free time I'll make a program to automate all that...

Step 5: "A small trick..."
Now for the fun part! :)
  1. Create another user on your computer named "Install" and make it an admin.
  2. Log off your current user account and login to "Install".
  3. Now log off again and back to your "regular" user.
  4. Open RegEdit and navigate to this key:
    "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
  5. You'll find a few subkeys like "S-1-5-18", "S-1-5-19", "S-1-5-20", and a few more with much longer names, starting with "S-1-5-21-".
  6. You will find one that has the following value: "%SystemDrive%\Documents and Settings\Install" for the "ProfileImagePath". Change that into "D:\Install\Delphi2007". Don't forget to create the folder too!
  7. Now go into Computer properties->Advanced->User Profiles, select the "Install" profile and use "Copy To".
  8. In the new dialog, browse to the folder "D:\Install\Delphi2007" and in the "Permitted to use" type "Install".
  9. Now delete "C:\Documents and Settings\Install".
  10. Log back on to "Install" and run the Delphi ESD Setup.
  11. Important step:
    when asked where to create the "shortcuts", answer "Just Me". If you choose "All users", you'll break this whole "leaning" process!
  12. Just let the installer run and you'll notice that the cache is now being created in:
    "D:\Install\Delphi2007\Local Settings\Application Data\{AB3EC276-D261-4943-A921-1CC1C6799AED}"
    Note: If you already have downloaded the install files, you can simply cancel the install, copy the previously cached install files into the folder above and resume the installer. Or create the folder before running the installer and copy the files there then run the installer... :)
    Note: When the installer finishes, or at some later time in the future, you can back up that folder to a DVD to be able to install later on another computer or at another time on that computer, should you reformat all...
  13. Finish the installer and let it run "Delphi 2007" for the first time. For the moment, disable the option to check for updates automatically. (You can check manually by using the shortcut provided).
Step 6: Final wrap up
Now we need to do a few more things:
- Ensure the "Check for updates" will work;
- Migrate the settings to your normal account.

Ensuring the "Check for updates" will work:
We will leave that Install user exist on your computer: it makes future upgrades easier... Whenever there is a new upgrade, just log back to this user and run the update from there.

Migrating user settings:
Copy "D:\Install\Delphi2007\My Documents\RAD Studio" to your "My Documents".

Run RegEdit and export the following keys:
HKEY_CURRENT_USER\Software\Borland (save as D:\Install\Borland.reg)
HKEY_CURRENT_USER\Software\Classes (save as D:\Install\Classes.reg)

Edit D:\Install\Borland.reg and update the DBExpress paths in this section:
[HKEY_CURRENT_USER\Software\Borland\BDS\5.0\DBExpress]
Alternatively, you can simply use it from that location and don't edit the paths.

Finally, copy "D:\Install\Delphi2007\Start Menu\Programs\CodeGear RAD Studio" to your normal account's start menu folder...

Now log onto your account and run those two reg files.

Step 7: Enjoy using your Delphi 2007 having spent only 1.06 GB of C: instead of 3.6 GB...

EDIT: Note for self. Short url for this page: http://preview.tinyurl.com/2qdrmz

2007-03-22

Delphi for Win32 - Part 5 - A new beginning

Well, after I finally prepared my dev machine intentionally without the .NET 2.0 Framework, I was once more ready to install Delphi 2007.

In doing so, I discovered that I had previously used an "incomplete" ISO for the install, hence the (non-problem) I reported of it trying to re-download the files. I'll re-install it again shortly, after restoring my pre-Delphi ghost image just to verify that.
[Edit: Well, I tried it again and found out that it wasn't my fault after all! The current installer requires the files on the folder pointed with the red arrow on one of the images below.]

The install process is divided into 3 parts:
- Detect/Download/Install pre-requisites (.NET 2.0 Framework, SDK and J# Runtime);
- Enter your registration data and make your selections;
- Download/Install the CodeGear related files.

As for the install options, here's what you have available in the Professional edition:


And here's the disk space used by the download and install:

As you can see from this, the install files (cached on the folder pointed to by the arrow), use roughly 1.4 GB. To that, you add approximately 1.5 GB of Microsoft related stuff (.NET 2.0 Framework, SDK, SDK install files, .NET 2.0 help files (part of the SDK but worth mentioning the waste of space when installing a "for Win32" type of development app!).

All in all, of the 2 GB needed (not counting the install files), only less than 700 MB are used by CodeGear: the remaining 1.4 GB is "spent" by Microsoft Runtimes, SDKs and tools.

For those more inclined to go and add all the bytes: the values above are approximations, give or take a couple hundred MB! I'm just too lazy to do all the math properly! :)

One nice thing about the install process: part 3 (the one where it installs CodeGear stuff), only takes around 4 minutes on my machine if you already have the files downloaded! Very fast indeed...

2007-03-20

Delphi for Win32 - Worldwide ESD Purchase?

I haven't tested this (other than seeing that the link works), but I received as an answer to my question of whether I could purchase the ESD and download it even from Portugal. Oddly enough, I received an answer that links to the Latin America Borland Shop.

I am already waiting on my already paid ESD from my local distributor but those of you out there stuck without a way to buy the ESD online may want to give it a try.

Here's the link: Delphi for Win32 ESD Worldwide Purchase.
[EDIT] At least one UK user tried and he could not make the purchase from there. Either someone thinks that Portugal is part of Latin America, or I don't see why they sent me that address to make the ESD purchase!]


Please post a comment stating your experience with that if you use it.

Delphi for Win32 - Part 2

Well, while I keep waiting for my Delphi for Win32 code to arrive, what else can I write about?

I can start with a word of warning for "wanna-be" ESD users: make sure your C: partition has plenty room available. And I don't mean a DVD-Size type of space, but at least twice as much!

Actually, I don't yet know, for the reason mentioned above, what exact space is needed, but I did run the installer and allowed it to fetch the pre-reqs (essentially .NET 2.0 SDK, hereafter referred to as simply SDK). That's pretty much all I can do until the code arrives, so I took a look at my C: drive. It was a bit of a shock to see that I had lost 1.6 GB of free space in my C: drive!

Why?

To keep it simple, 600 MB for the SDK install files that the Delphi installer caches under Documents and Settings, 600 MB for another copy of that file that is simply copied inside a "Microsoft Visual Studio 8" folder in My Programs, and the same contents but this time after extraction partly to Program Files and partly to Documents and Settings.

That's a whole lot of space! And I've yet to start downloading Delphi's own setup files! I wonder if I have enough free space on my C: drive to continue the installation.

And, of course, it's also worth mentioning that of those SDK files actually installed, around 400 MB are pretty useless to me and to pretty much every Delphi for Win32 user: they're the .NET documentation files...

Delphi for Win32 - Part 1

In these multi-part posts about the newly released Delphi for Win32, I'll be blogging about my ordering, installation and usage experiences.

Part 1 (this one you're reading), is about the new ESD version that is available from CodeGear starting with Delphi for Win32.

So, now you have an ESD (Electronic Software Delivery?), meaning that, in theory and using CodeGear's own words, you get "Instant gratification".

I'm a big fan of ESDs: ever since there were internet purchases I've been doing them and all over these years, I've easily made over 100 such purchases. The big advantage of an ESD is to allow you to skip all that lengthy process of duplicating the CDs/DVDs and distributing them all over the globe, so, in theory, it's a nice idea.

Now let me talk a bit about CodeGear's first ESD: Delphi for Win32.

Having attended the CodeRage virtual conference last week, I was caught by surprise on Friday, the closing day, that CodeGear had started to ship Delphi for Win32. So, time to grab my credit card and go check their site... Hmm... There's no such thing as Portugal on their listing, so I'll have to try Spain instead.

Cuting a looong story short, let me just say that I did fight for a few hours trying to find a CodeGear online shop/partner/whatever that would allow me to have that "instant gratification". It turns out that I was expecting too much for two main reasons:

1) In these days of e-commerce and EEC, they block sales from their resellers to other countries, maybe it's something from Borland age and has to do with some business areas but still incomprehensible in these global days we're living;

2) The other reason I was expecting too much was because it wasn't actually official until next Monday, so, Friday was not the release date as I initially thought.

That much I learned after "bugging" DavidI and Michael Swindell.
Having learned that I waited until next Monday to be contacted, as promised by CodeGear. And, in fact, I was: first by a Portuguese retailer, then by a Spanish distributor telling me they had instructed that Portuguese retailer to get in touch with me.

And so they did: after answering their initial request as to what product I was interested in, I waited a few more hours. Late, near business day end, they contacted me again with pricing (there was an issue with using a special CodeRage attendant discount), and, after they told me how to buy the "ESD", I made a wire transfer and mailed them back. I had been told that, from the moment I placed my order, it would have taken 12 hours to receive the "ESD" (gosh: internet is sooo slow!), but 16 hours are gone now and still no code in my mail... :(

[EDIT: It turns out, from their answer just now, that it's 12 "business hours"; considering that they sent me the wire transfer data at the end of yesterday's business day, and even though I made the transfer right away and with 40 minutes to spare, they only picked up my order process today! So, if it's 12 "business hours", this means that ESD for Portugal = 3 days from start to finish... And I thought the year was 2007!!]

Meanwhile, bugging Michael a bit more, I managed to start the Download/Install procedure: I'm yet to get past that stage where I have to enter the yet to be received key, but at least I've now allowed the ESD installer to download the 600 MB of pre-reqs. (More on that on my next post!)

Final notes:

1) For their first ESD experience, I've read that it isn't going that bad, at least in "Civilized" countries for which they have online stores and allow that "instant gratification"; there were a few issues over the weekend but since it was not even supposed to be working 'til Monday, that's no big deal.

2) They *do* need to sort things out for the remaining countries: buying an ESD by using FAX order forms and/or wire transfers is not the way ESDs were meant to be! My suggestion: until local retailers are capable of providing that "instant gratification" experience, allow other retailers to at least sell the ESDs for those countries. If the local retailers don't want to loose on those customers, then they will catch up.

Unless they sort this out, some developers will be 1st class customers with "instant gratification", while others will have to wait, and wait, and wait...

3) CodeGear support was impressive. They have gone to all the lengths to have the right people talk to me and allow me to place the order. It's a bit slow process in Portugal, unfortunately, but I hope that sometime later today I'll be completing the install.

So, stay tuned for more comments on Delphi for Win32...