Friday, July 31, 2015

debugging related techniques

good debugging tricks

  1. Help Yourself in Debugging (Part-2) using Breakpoint/Tracepoint
  2. Help yourself in Debugging by using Call Stack and Immediate Window
  3. Debug Tutorial Part 6: Navigating The Kernel Debugger
  4. Debug Tutorial Part 5: Handle Leaks
  5. Debug Tutorial Part 4: Writing WINDBG Extensions
  6. Debug Tutorial Part 3: The Heap
  7. Debug Tutorial Part 2: The Stack
  8. Debug Tutorial Part 1: Beginning Debugging Using CDB and NTSD
  9. Windows Debuggers: Part 1: A WinDbg Tutorial

Windows installer technology

  1. Best Practices for Windows Installer
  2. Tao of the Windows Installer, Part 1
  3. Tao of the Windows Installer, Part 2
  4. understanding windows installer
  5. Roll Your Own Windows Installer Setups

Specifications from Microsoft

  1. Windows Installer Best Practices
  2. Property Reference
  3. Windows Installer Guide
  4. Windows Installer
  5. Windows Installer- good index from
  6. Roadmap to Windows Installer Documentation
  7. About Windows Installer
  8. About the Installer Database
  9. Using the Installer Database
  10. Windows Installer Reference
  11. Installer Database
  12. Database Tables
  13. An Installation Example

specific techniques on different platforms

  1. Deploy sideloaded windows 8 app in production
  2. Deployer
  3. Deployer

WiX related stuff

good aticles on Wix.
a good tool to generate guid:
Create a GUID
WiX offical manual
WiX Toolset Manual Table of Contents
Tools for WiX
WiX editors.


  1. WiX Tutorial
  2. A quick introduction: Create an MSI installer with WiX
  3. WiX Tricks
  4. WixUI Dialog Library
  5. Yet Another WiX Tutorial - Part 2 - Adding the UI
  6. Yet Another WiX Tutorial
  7. Adding and Customizing Dialogs in WiX 3
  8. Custom Action Tutorial Part I – Custom Action Types and Sequences
  9. Custom Action Tutorial Part II – Creating the Project
  10. Custom Action Tutorial Part III – What we did in Part II
  11. CustomActions and uninstalls
  12. WiX toolset mailing list
  13. dotNetInstaller - Setup Bootstrapper for .NET Application
  14. Creating a Localized Windows Installer & Bootstrapper: Part 1
  15. Creating a Localized Windows Installer & Bootstrapper: Part 2
  16. Creating a Localized Windows Installer & Bootstrapper: Part 3
  17. Creating a Localized Windows Installer & Bootstrapper: Part 4
  18. Part 1 of Writing Your Own .Net-based Installer with WiX – Overview
  19. Part 2 of Writing Your Own .Net-based Installer with WiX – Creating the Projects in Visual Studio
  20. Part 3 of Writing Your Own .Net-based Installer with WiX – Context Data
  21. Part 4 of Writing Your Own .Net-based Installer with WiX – Handling Current and Future State
  22. Part 5 of Writing Your Own .Net-based Installer with WiX – Executing the Action
  23. Part 6 of Writing Your Own .Net-based Installer with WiX – A Note About UAC
  24. Extracting WiX Bundled MSI Files Without Running The Installer
  25. Allowing The User To Select The Install Folder
  26. Installing VSIX package via WiX installer

  27. installer related tools to clean up messes...

  28. Msicuu Overview
  29. Msizap Overview
  30. Windiff Overview
  31. Alphabetical List of Tools
  32. A Windows Installer Database Diff Tool
  33. Utility Spotlight

  34. good blog from UK worthy reading

  35. Customised UI's for WiX - good blog on WiX
  36. this is really good series from micrsoft guy...

  37. From MSI to WiX
  38. From MSI to WiX, Part 20 - User Interface - Required Dialog Boxes

Misc Tools for productivity:

  1. Diff tool
  2. RGDiff - Visual Diff Tool
  3. Your Development Tools
  4. TOOL-(TOOL (Tiny Object Oriented Language) is an easily-embedded, object-oriented, C++-like-language interpreter.)

good blog list

  1. Life, Efficiency & Development
  2. Spooky Coding at a Distance

Saturday, July 25, 2015

install your software per user or per machine?

this is A question that every installer needs to decide.
the original link is here: HKCU or HKLM - Where should a setup install registry data
another link worthy reading:
ACTIVE SETUP AND HOW TO IMPLEMENT IT

here is good guideline and I copied from above link for my personal use.

Making an application write to HKCU or HKLM depending on the ALLUSERS value (per user or per machine install) sounds good in theory, but in practice I have never used this approach. Note that what I write below is rather subjective based on concrete experience.

The general idea of a per user install is for people to be able to have their application and license only available to themselves, but also to support different language installations, and versions and stuff like that. Very few applications venture into this realm of usability without making it an integrated application feature, rather than an installation version or choice. It is seldom an absolute requirement that no other users on the same PC should be able to use the application, and if it is - then licensing is often centrally managed via client-server technologies and not just a serial key in the registry.

In my view applications on Windows are generally installed and available to everyone on the PC, and my preference is to lock the install to be per-machine. There are too many problems, idiosyncrasies and test cases for a per user install to be desirable. The per user installation logic and the way it redirects some installation folders and still allows multiple installs - some per machine - is also poorly designed - at best. If not purely illogical. Terminal server installations may be different, but that is a different topic entirely.

I write only minimal values to HKLM, and ensure that it can be treated read-only after installation. I typically write data entered into the setup GUI such as license keys, language setting and similar to HKLM. When the application launches it checks if there is data in HKLM and applies these to HKCU to set up a proper runtime environment. And critically: should data from HKLM be unavailable, the application should actually apply "internal defaults" from the application's startup routine in my opinion - this is to ensure the application can start even with no registry data available - this also helps during application debugging. The only case I can recall where the application should fail to launch is if there is insufficient permissions to write to HKCU or the userprofile folders.

So in some sort of a summary I would:

  1. * Lock the install to install per machine / avoid per user installs - this avoids all sorts of problems, particularly with patching and advanced installation features. The setup must run elevated.
  2. * Ensure the application is capable of starting from "internal defaults" set in the EXE file's startup routine and populate HKCU largely from defaults, and also to be able to copy any values written to HKLM during install. Launch can still fail if there are files missing that are required for launch.
  3. * Minimalize all registry data in HKLM. Treat it as read-only data capable of being copied to HKCU
  4. * Write a version value in HKLM with your setup and have the application compare to an equivalent in HKCU. If the value in HKLM is higher than HKCU, the application re-applies or updates values accordingly in HKCU. This is necessary to ensure you can enforce new default values for old keys in new versions of the application, or delete obsolete keys or buggy values. These values must be fixed for all users. Using the version value logic your application's startup logic can perform different logic for different application versions. This avoids all need to mess around with HKCU data manually with scripts and hotfixes if there are errors to take care of.

    HKLM\Software\Company\App\Version\InstallationVersion = 1.2.0
    HKCU\Software\Company\App\Version\InstallationVersion = 1.1.0
This was a lot of information based on real-world setup experience written in a hurry. Please add any questions - I might have forgotten something important.

number one case study: this link contains good article too.
Creating an Installation Program for Windows Vista and Windows 7
the article list is here
Articles / Documents - Index

A good discussion for installer is here:
Editing the Registry

this active setup is worthy reading too:
Active Setup Registry Key : What it is and how to create in the package using Admin Studio Install Shield.

more understanding on registry hive HKCU.

when test software installation, an item is written into HKCU hive of windows registry.
here is good post to understand HKCU. please check it out:
Details on the HKEY_CURRENT_USER Registry Hive

a quick jumpstart from this link:
Windows Registry FAQ and HowTo Tutorial

This post has a detailed description on FAQs of registry
Frequently Asked Questions of Registry Workshop

another good article is on technet and worthy reading.

how to find out HKCU item for control panel is in this article.

A very good quick summary is posted here. you can pick up very quickly for overall picture.

a deep dive on application of these concepts, please read this good post on application compatibilty.

An item related with advanced installer is useful when I build installer. Keep good eyes on this paper.

good post keeps expanding. please check out this post.
Dealing with the registry

an example for inno installer is [Registry] section

Windows permission for registry entry is in this post:
Windows 7 Default HKCU Registry Permissions
free tools to check out

A good list of most popular registry tool: Adding Registry Settings

this is a good case study: Activation of Client Side Products and Registry Basics

another good case study:

  1. Windows Registry Persistence, Part 2: The Run Keys and Search-Order
  2. Windows Registry Persistence, Part 1: Introduction, Attack Phases and Windows Services

another case study:
How to Setup a Package Containing HKCU (Current User) Registry to Install for Each Profile User on a Windows XP or Later PC

A good discussion on installer for registry writing is here:
HKCU or HKLM - Where should a setup install registry data

registry monitoring tools

I need to monitor the changes of my computer registry changes because I am testing software installation process.

here are good links for these tools:

  1. RegMon for Windows v7.04. this is outdated tool.
  2. Process Monitor v3.2
  3. DiskMon for Windows v2.01
  4. this is a good link.

    You will find an open source tool to compare the difference of registry at different state. please download from regshot

  5. a registry manager software is good to try too: Registrar Registry Manager 7.

it turns out the regshot meets my need easily.

how to make my own portable hard drive?

I got a hitachi 2.5 inch hard drive. it is well known that its quality is outstanding. So I got an enclosure and put this hitachi hard drive into it. it is 120G and I need to use it transfer testing data between machines. so it meets my needs. the hard drive is good deal, only $20.

Friday, July 24, 2015

how to image hard drive?

I got several old Dell precision workstation and want to set them for test machine. So I plan to install each avaiable Windows on them. when I set them up in the right status, I want to backup each of these hard drive. So I want to image each hard drive in case hard drive failure. so I can boot up using the hard drive with right image.

Many software tools are available, but you want to pay. I did research and find quick and easy solutions.

  1. for hitachi hard drive
  2. please download image software from hitachi website. the tool is called HGST Windows Drive Fitness Test (WinDFT). it also contains user guide too.

    for legacy sotware download, please download from here.

    good FAQ is here. it looks like Hitachi is a Western Digital cpompany now. you can run drive fitness test on your hard drive to find if it contains defects.

    I find out a good tool here. standard version meets my needs already.

    after you imaged your hard drive, do verification right away, either through software, or install onto Dell workstation, unplug exsiting hard drive and replace this hard drive with the image.

    I find it from this thread the answer is..

  3. for western digital hard drive
  4. for western digital hard drive, this software may still be useful: Acronis True Image Western Digital Edition Software 16.0.0.5962

    It turns out that on western digital website, it has Acronis true image for western digital version. So it is free. please download it from Acronis True Image WD Edition Software.

  5. for seagate hard drive
  6. Seagate also offers its own tool DiscWizard. The FAQ has many good points you can learn lots of concepts from this page.

a good commercial product is handy backup software.