Conditional registration in Add/Remove Programs - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Olexa
Posts: 17
Joined: Wed Jun 04, 2008 11:34 am

Conditional registration in Add/Remove Programs

Is there any way to make registration in Add/Remove Programs conditional, depending on selected features?

My installation consists of two features, I allow user to select only one of them. First one requires registration in Add/Remove Programs, and second one should not be registered there.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional registration in Add/Remove Programs

Hi,

I'm afraid that this is not supported by Advanced Installer. Advanced Installer sets the package to not be registered by eliminating some standard actions when the package is built. Therefore, the registration of the package cannot be set dynamically.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Olexa
Posts: 17
Joined: Wed Jun 04, 2008 11:34 am

Re: Conditional registration in Add/Remove Programs

Hi, Cosmin,

Is there any way to modify InstallExecuteSequence table on the fly, either to remove RegisterProduct, RegisterUser , PublishProduct and PublishFeatures actions (as per this), or set conditions for them? I made a try to do that with Custom Action, but it seems that Session.Database is read only at runtime. Is that so?

Regards,
Oleksii
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional registration in Add/Remove Programs

Hi,

In order to not register the package with Windows Installer, you need to remove the standard actions from the MSI when it is created. This is done automatically be Advanced Installer or your can manually edit the MSI with Orca. Basically, is the standard actions are present in the MSI, it will be registered, if they are absent, the MSI will not be registered.
Is there any way to modify InstallExecuteSequence table on the fly, either to remove RegisterProduct, RegisterUser , PublishProduct and PublishFeatures actions (as per this), or set conditions for them?
I'm afraid that you cannot modify the MSI file at runtime. You could perform a temporary modification through a custom action, but most likely it will not work as you need. Also, you could try to manually condition the standard actions (through Orca), but I'm not sure if it will work and most likely the package will have validation errors.

Note that what you need is not supported by Windows Installer and Microsoft recommends to register the package with Windows Installer.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Olexa
Posts: 17
Joined: Wed Jun 04, 2008 11:34 am

Re: Conditional registration in Add/Remove Programs

Hi, Cosmin,
cosmin wrote:Note that what you need is not supported by Windows Installer and Microsoft recommends to register the package with Windows Installer.
My installation consists of two features. User is allowed to select only one of them. First feature installs product onto PC, second one installs in onto separate hardware device, connected to PC as a removable drive. So, there is no any logic to leave any trails in registry, if user chooses second option.
cosmin wrote:Also, you could try to manually condition the standard actions (through Orca), but I'm not sure if it will work and most likely the package will have validation errors.
I did not found any information on Microsoft about whether it is allowed to set conditions for RegisterProduct, RegisterUser, PublishProduct, and PublishFeatures Actions in InstallExecuteSequence and AdvtExecuteSequence tables. But I have found that some people recommend that:

http://www.prairienet.org/~pops/msi_tips.html
http://www.installsite.org/pages/en/msi/isd.htm

I set condition for these actions to "&FirstFeature = 3" with Orca, and it works just fine. So I'm going to try this way.

But I need to make single-file EXE installation with LZMA compression. So, the next question is:

Is it possible in Advanced Installer to modify generated MSI with Orca, and then build final single-file EXE installation manually (probably, using 7-zip, AI\stubs\setup.exe, notepad for editing ini file, copy /b, binary editors, whatever)?

Thank you,

Olexa
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional registration in Add/Remove Programs

Hi,
Is it possible in Advanced Installer to modify generated MSI with Orca, and then build final single-file EXE installation manually
I'm afraid that this is not supported by Advanced Installer. However, you can try this approach:
- go to the Media page and select the LZMA compression option
- go to the Bootstrapper tab and select the "Leave install files outside" option
- build the project
- go to the build folder and find the 7z archive which contains the MSI
- extract the MSI and modify it
- archive the MSI into a 7z archive which has the same name as the original one

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Olexa
Posts: 17
Joined: Wed Jun 04, 2008 11:34 am

Re: Conditional registration in Add/Remove Programs

Hi Cosmin,
cosmin wrote:I'm afraid that this is not supported by Advanced Installer. However, you can try this approach:
- go to the Media page and select the LZMA compression option
- go to the Bootstrapper tab and select the "Leave install files outside" option
- build the project
- go to the build folder and find the 7z archive which contains the MSI
- extract the MSI and modify it
- archive the MSI into a 7z archive which has the same name as the original one
Yes, but multi-file installer would not be useful for users to download it from web site.

One way may be to create MSI with all file included without compression by Advanced Installer (Archive installation files into CAB files, do not Compress CAB files for smaller size, Include CAB file into the MSI database, do not Create EXE setup file), modify it by Orca, and then create 7-zip self extractor that would extract MSI into temporary folder, run msiexec on it, wait for return and then delete that temporary folder. But I'm not sure there is such SFX bootstrapper already. Also, this way would not be optimal in terms of temporary disk space required and uncompression time, because it would uncompress all components into temporary folder, despite of what components are going to be installed, and instead of umcompressing necessary files directly to destinations (if this is possible at all).

If there is no ready to use 7-zip bootstrapper with required functionality, LZMA compressed EXE installation with files outside may be created with Advanced Installer (Archive installation files using LZMA compression for smallest package size, Leave install files outside) and some other archiver may be used for creating single self extracted archive without compression. But drawback would be the same.

The best way would be to create such bootstrapper for 7-zip self-extractor (in VC++, whatever), that would extract just MSI into separate folder, run it, MSI would run original self-extractor with some command line options to extract needed files during installation, and original process would delete temporary MSI when it finishes. This would minimize disk space usage and extraction time during installation.

Regards,

Olexa
Olexa
Posts: 17
Joined: Wed Jun 04, 2008 11:34 am

Re: Conditional registration in Add/Remove Programs

Olexa wrote:One way may be to create MSI with all file included without compression by Advanced Installer (Archive installation files into CAB files, do not Compress CAB files for smaller size, Include CAB file into the MSI database, do not Create EXE setup file), modify it by Orca, and then create 7-zip self extractor that would extract MSI into temporary folder, run msiexec on it, wait for return and then delete that temporary folder. But I'm not sure there is such SFX bootstrapper already. Also, this way would not be optimal in terms of temporary disk space required and uncompression time, because it would uncompress all components into temporary folder, despite of what components are going to be installed, and instead of umcompressing necessary files directly to destinations (if this is possible at all).
There is such 7-zip bootstrapper:

http://www.msfn.org/board/How-to-make-a ... 39048.html

And it might be better to Create EXE setup file in Advanced Installer for this bootstrapper.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional registration in Add/Remove Programs

Hi,
The best way would be to create such bootstrapper for 7-zip self-extractor (in VC++, whatever), that would extract just MSI into separate folder, run it, MSI would run original self-extractor with some command line options to extract needed files during installation, and original process would delete temporary MSI when it finishes. This would minimize disk space usage and extraction time during installation.
Please note that Advanced Installer already supports this feature through its EXE bootstrapper. The only difference is that the MSI is packed automatically in the EXE at build-time, and not after you modify it manually (this cannot be modified).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Olexa
Posts: 17
Joined: Wed Jun 04, 2008 11:34 am

Re: Conditional registration in Add/Remove Programs

Hi, Cosmin,
cosmin wrote:
The best way would be to create such bootstrapper for 7-zip self-extractor (in VC++, whatever), that would extract just MSI into separate folder, run it, MSI would run original self-extractor with some command line options to extract needed files during installation, and original process would delete temporary MSI when it finishes. This would minimize disk space usage and extraction time during installation.
Please note that Advanced Installer already supports this feature through its EXE bootstrapper.
That's nice!
cosmin wrote:The only difference is that the MSI is packed automatically in the EXE at build-time, and not after you modify it manually (this cannot be modified).
Is there any possibility to make a pause after MSI is built, but before it is compressed to EXE, to modify it with Orca or script? Or to convert Advanced Installer installation with files outside EXE to single-file EXE installation?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional registration in Add/Remove Programs

Hi,

We will consider adding these features in a future version of Advanced Installer. Thank you for your suggestions.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Olexa
Posts: 17
Joined: Wed Jun 04, 2008 11:34 am

Re: Conditional registration in Add/Remove Programs

Olexa wrote:Is there any possibility to make a pause after MSI is built, but before it is compressed to EXE, to modify it with Orca or script? Or to convert Advanced Installer installation with files outside EXE to single-file EXE installation?
Is it possible to run some action (script) after MSI is extracted, but before it is run during installation? This would allow to modify MSI during the installation, and keep all advantages of Advanced Installer's single-file LZMA EXE installations (optimal temporary disk space utilization and extraction time).
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional registration in Add/Remove Programs

Hi,
Is it possible to run some action (script) after MSI is extracted, but before it is run during installation?
I'm afraid that this is not supported by the EXE bootstrapper.
This would allow to modify MSI during the installation
Please note that a MSI cannot be modified during its installation. In the best case scenario you could use a custom action which performs some temporary modifications, but most likely it will not work the way you need.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Olexa
Posts: 17
Joined: Wed Jun 04, 2008 11:34 am

Re: Conditional registration in Add/Remove Programs

cosmin wrote:Please note that a MSI cannot be modified during its installation.
Yes, that's why I wanted to modify it before it is run.
Olexa
Posts: 17
Joined: Wed Jun 04, 2008 11:34 am

Re: Conditional registration in Add/Remove Programs

cosmin wrote:
The best way would be to create such bootstrapper for 7-zip self-extractor (in VC++, whatever), that would extract just MSI into separate folder, run it, MSI would run original self-extractor with some command line options to extract needed files during installation, and original process would delete temporary MSI when it finishes. This would minimize disk space usage and extraction time during installation.
Please note that Advanced Installer already supports this feature through its EXE bootstrapper. The only difference is that the MSI is packed automatically in the EXE at build-time, and not after you modify it manually (this cannot be modified).
Unfortunatelly, Advanced Installer's bootstrapper extracts everything from single-file LZMA-compressed EXE installation (with all install files included in EXE) into [AppDataFolder][|Manufacturer]\[|ProductName]\install. This requires as much additional space during installation, as all uppacked installation files consume. This price is too high.

I meaned that it would be nice to extract just MSI for InstallUISequence sequence, and extract application files at the InstallExecuteSequence, only those of them, that are goig to be installed, and directly to the folder where they are being installed to. This way will require as little additional space during installation, as MSI's size is.

Or did I miss the way Advanced Installer supports this?

Return to “Common Problems”