Repackaging an existing installation in a VMware virtual machine

ImportantThe following article uses options that are available starting with the Architect edition and project type.

This tutorial will guide you in creating a project based on capturing an existing installation. It is similar to Repackaging an existing installation with the difference the capture is performed in a virtual machine (VMware).

When performing the repackaging operation in a clean virtual machine, you assure no running application conflicts are generated. Also, the capture takes less time if the machine is clean. Moreover, if something goes wrong you can easily restore the virtual machine to a previous state. This is usually how installation tests are professionally handled.

This tutorial repackages the 7-zip File Manager into an MSI as an example.

1. Start a "Repackage Installation" project

If Advanced Installer is not currently running, launch it by double-clicking its desktop icon or selecting it from the "Start" menu. When the application starts, you will see a dialog where you can choose “Convert” > “Repackage Installation” project type.

New Repackage Installation Project

The Repackager Wizard will be launched assisting you to configure the new installation capture.

2. Choose to start a new installation capture

Select the option to "Repackage an application in a virtual machine" then press the Edit link button.

Start New Capture

NoteOn 64-bit operating systems, the Repackager tool automatically runs its x64 version, in order to accurately capture 64-bit installations. If you wish to override this default behavior and force the use of the 32-bit Repackager on 64-bit systems, you can use the /ForceX86 command line switch (Repackager.exe).

3. Select the virtual machine profile

Select or configure the virtual machine profile with the snapshot to be used as host for the repackager. Make sure the user specified on this dialog has admin privileges then press [ OK ]. Press [ Next ] in the parent dialog.

NoteThe following steps describe choosing the virtual machine environment. If you want to perform the repackaging operation on your local machine, you can follow Repackaging an existing installation tutorial.

Repackaging Location

ImportantIt is important you first prepare the virtual machine before starting your first capture. Please check the requirements for repackaging in VMware machines to make sure your environment is correctly setup.

4. Package Information

In this dialog you must select the location of the setup that you want to repackage. Also, you can specify additional behavioral options for the repackager, to optimize your flow.

Package Information

NoteAdditionally, you can configure multiple applications to be repackaged at once, use "Additional packages" link to add them.

5. Customize Settings

Select the output path for the installation capture files, and customize the capture profiles.

Customize Settings

When the "Use process monitor in conjunction with system scan" option is used the Repackager will ignore any output generated by processes which were already running before the repackaging operation starts.

Next we shall create a new installation capture profile that is best suited for our needs. Select "New Profile" from the "Current Profile" combo and click the link Edit.

6. Create installation profile

We created a new profile "7-zip Profile", which we have tweaked to search for system changes only in the "ProgramFiles" folder and in the "HKEY_LOCAL_MACHINE" registry hive, as the setup package installs per machine. All the other settings remained as in the "Default" profile.

We set this newly created profile as active (current). The profile that is "active" is that one that will be used during the system scan unless specified otherwise at the beginning of the installation capture.

Create Profile

7. Installation Capture

Press [ Next ] to start the installation capture. Before you proceed make sure that you close all unnecessary running applications in order to avoid "false positive" capture results from active file and registry system access.


8. Package Installation

During this process your setup file will be launched inside the virtual machine with the command line you specified in the "Collect Information" page. Complete the installation as you would normally do.

After the installation has completed, the system will be scanned again for changes.

9. Finish

When the installation capture completes you can view a summary report indicating the system changes detected during package installation by pressing the View Repackager statistics link.


10. Import results

Press [ Finish ] button to import the installation capture results into a new Advanced Installer project.


11. Customize Project

After importing the installation capture results you should review the Advanced Installer project and adjust it to your new package deployment needs.

ImportantAt this point you don't need the old repackaged package or any of its dependencies. All necessary resources have been added next to the .RPK file in the repackager's output location.

12. Build Project

BuildBuild and run the project to test it.

The End

This concludes our tutorial.