Executing a .REG file that is outside the install package - 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!

Ashoks
Posts: 15
Joined: Thu Jan 07, 2010 4:25 pm

Executing a .REG file that is outside the install package

Hi,

I was unable to find a solution in AI for my requirement which is as follows:
Say, we distribute our product's installer in two (or ten etc.) different CDs. The installer package is identical on these CDs. The only difference is the contents of an external .REG file which is located in the same folder that has the .MSI file. I want the .REG file to be executed on the target computer after the installer has been run. This way a different registry gets set depending on the CD from which the user installed our product.

FYI, my installer consists of bootstrapper setup.EXE with a seperate .MSI that contains all the CABs.

Thank you,
-Ashok
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Executing a .REG file that is outside the install package

Hello,

You can use the reg command line utility to import the .reg file. To do this:
- create a launch file or open url custom action that launches the reg utility
- in the custom action's Command Line field, write import [SETUPEXEDIR]yourregfilename.reg
SETUPEXEDIR is the property that holds the path to your .exe installer. Use SOURCEDIR instead, if you don't have an .exe installer.

Let me know if this works for you.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Ashoks
Posts: 15
Joined: Thu Jan 07, 2010 4:25 pm

Re: Executing a .REG file that is outside the install package

Thank you for the fast response. One related question: Will this also work for the installer configuration where I have an easily distributable Setup.EXE which retrieves the MSI from an online location? Obviously, in this case I will have to keep the .REG file in the online location next to the .MSI

Thanks,
-Ashok
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Executing a .REG file that is outside the install package

Hi Ashok,

No, I'm afraid that the REG file is not downloaded automatically. This works only when the files are distributed together.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ashoks
Posts: 15
Joined: Thu Jan 07, 2010 4:25 pm

Re: Executing a .REG file that is outside the install package

I see. Also, I ran into an issue with the 64-bit version of our installer package. Calling REG.exe from the custom action (as suggested by you) is accessing the 32-bit area of the registry instead of the native 64-bit area. The installer package is set as 64-bit. Any idea how I can resolve this issue?
Thanks,
-Ashok
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Executing a .REG file that is outside the install package

Hi,

This is normal to happen because our predefined custom action "Launch File or Open URL" is a 32 bit executable file.

What you need is a custom 64-bit executable, that you can make, to launch REG.exe, this way you will be redirected towards the correct registry hive.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ashoks
Posts: 15
Joined: Thu Jan 07, 2010 4:25 pm

Re: Executing a .REG file that is outside the install package

Hi, I wish 64-bit was also supported by the custom action process and hope you will fix this in the next version. In the meantime, I will have to implement as you suggest. So, I will have to make my new EXE (that in turn launctes REG.EXE) part of the installer package. Should I drop it in the Application's folder? Is there a "hidden" installer folder where I can keep this hidden? I would also need another custom action that will invoke another private EXE during uninstall to remove the registry entries imported during install. How should I sequence this custom action?

Thanks for your help,
-Ashok
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Executing a .REG file that is outside the install package

Hi,
Should I drop it in the Application's folder? Is there a "hidden" installer folder where I can keep this hidden?
No, the EXE can be added as a New Attached Custom Action. This will make the installer always keep a copy of the EXE in it but will not install this file,
it will just be used for this custom action.
I would also need another custom action that will invoke another private EXE during uninstall to remove the registry entries imported during install. How should I sequence this custom action?
This can be done very easily, simply add another custom action right next to the one that runs during install and set its condition to :

Code: Select all

REMOVE=ALL
This will make the custom action to run only during the uninstall process.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ashoks
Posts: 15
Joined: Thu Jan 07, 2010 4:25 pm

Re: Executing a .REG file that is outside the install package

Hi Bogdan,

That worked. Thanks! So, my issue stands resolved for the build configuration where the MSI is located "next" to the bootstrapper EXE.

However, I'm still searching for a solution for the configuration where I have an easily distributable setup EXE which retrieves the MSI from an online location. I tried creating a self-extracting EXE (using package-for-the-web) that contains only this setup EXE and the .REG file. Launching this self-extracting EXE on the target computer did install the application but my custom action EXE that imports the .REG file did not get executed. Any suggestions on how to make this work?

Regards,
-Ashok
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Executing a .REG file that is outside the install package

Hello,

I am not sure what you did. How did you launch your executable that imports the reg file, where did you place it and how do you know it did not execute?

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Ashoks
Posts: 15
Joined: Thu Jan 07, 2010 4:25 pm

Re: Executing a .REG file that is outside the install package

Sorry, my bad. I forgot to copy the latest .MSI files to the online location before testing. Everything worked as expected when I did that.

Thanks for your help!
-Ashok

Return to “Common Problems”