The 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 (Hyper-V).
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
- 2. Choose to start a new installation capture
- 3. Select the virtual machine host
- 4. Select the virtual machine profile
- 5. Package Information
- 6. Customize Settings
- 7. Create installation profile
- 8. Installation Capture
- 9. Package Installation
- 10. Finish
- 11. Import results
- 12. Customize Project
- 13. Build 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.
The Repackager Wizard will be launched assisting you to configure the new installation capture.
Select the option to "Repackage an application in a virtual machine" then press the Edit link button.
On 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).
You can use virtual machines from localhost or connect to remote Hyper-V hosts in your sub-network. Use the "New Server Connection" context menu option while Hyper-V Servers is selected in the left pane, then configure the connection credentials.
The following steps describe configuring the virtual machine environment. If you want to perform the repackaging operation on your local machine, you can follow Repackaging an existing installation tutorial.
Select or configure the virtual machine profile with the snapshot to be used as host for the repackager then press.
It is important you first prepare the virtual machine before starting your first capture. In case of remote connections, having Advanced Installer tools installed on the VM is mandatory. Please check the requirements for repackaging in Hyper-V machines to make sure your environment is correctly setup.
Pressin the parent dialog.
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.
Additionally, you can configure multiple applications to be repackaged at once, use "Additional packages" link to add them.
Select the output path for the installation capture files, and customize the capture profiles.
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.
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.
Pressto 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.
If the repackager does not start running in your VM, it could be due to a changed configuration of your Autorun behavior from the guest OS installed in your VM. In this case you can launch the repackager manually from the guest OS, just open Windows Explorer and double-click our “Advanced Repackager“ virtual CD/DVD drive. To manually launch the guest instance of the Repackager, you can execute run.bat located in the root directory of the “Advanced Repackager“ virtual CD/DVD drive.
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.
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.
Pressbutton to import the installation capture results into a new Advanced Installer project.
After importing the installation capture results you should review the Advanced Installer project and adjust it to your new package deployment needs.
At 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.