Netflunky
Posts: 4
Joined: Sun May 16, 2010 4:37 pm

Changing the package Install Drive

Mon May 24, 2010 5:26 pm

I am new to the forums, so please excuse me if I am being a bit stupid and have missed something obvious.

We are a secondary school and all our stations have a C and a D drive. Applications are installed to the D drive. I have searched the forum and the Advanced Installer Help and cannot find the way that this can be set to default to the D:. Can anyone advise. This is important as we use group Policies to roll out apps.

TIA

derfsplat
Posts: 19
Joined: Mon Jun 05, 2006 10:28 pm

Re: Changing the package Install Drive

Mon May 24, 2010 10:01 pm

There are probably a few ways to do this. The easiest that I can think of is making use of the public MSI property "APPDIR". If you are pushing out these packages and your drives/install paths are therefore standardized, you can "push" the APPDIR location to the installer at install-time. Use a command line like this:

MyInstaller.exe APPDIR=D:\MyPath

You can pass public properties to the msi (properties that are in all UPPERCASE are public and can be set from outside the msi) as PROPERTYNAME=value.

APPDIR dictates the install location of the msi. If you need something customized in the command line- say user name as a bad example :)- you could inject this into the APPDIR path in your logon script. You mentioned you use group policies and the last time I had done anything with logon scripts was probably Win2k with crusty batch files so I'm sure a thing or two has changed but the basic idea will be the same. Given a variable %username% that contained the current username, you could set the command line to:

MyInstaller.exe APPDIR="D:\Program Files\%username%"

Hope that helped!

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

Re: Changing the package Install Drive

Tue May 25, 2010 9:15 am

Hello,

You could change APPDIR to change the default installation directory of the installer. But I personally see that as curing the symptom and not the cause.
My suggestion is you instead change the location of the "Program Files" directory on your machines i.e moving them 'Program Files' to drive D. I highly recommend doing this right after a fresh install of Windows in order to avoid breaking already installed programs.
The following registry values hold the location of the "Program Files" folder:
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir (x86) (on 64bit platforms)
- HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\ProgramFilesDir (on 64bit platforms)
- HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\ProgramFilesDir (x86) (on 64bit platforms)

Change them accordingly.
The advantage of doing this is all installers will default to installing to your d:\program files instead of c:\program files and you don't have to do anything at all in your installer. In addition, not changing APPDIR in your own installer means your installer will also work on machines that do not have a drive D.

Let me know if this works for you.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Netflunky
Posts: 4
Joined: Sun May 16, 2010 4:37 pm

Re: Changing the package Install Drive

Tue May 25, 2010 11:01 am

Thanks to both of you. Changing the path in the registry is not really a starter as we have approx. 450 stations and laptops, some with between 60 and 100 applications on them. We do have a few applications that need to go on the C:\ as well as the O/S. We roll out packages via group policies, sometimes using an MST created with Wise tailor though that does not always work, so that when the computer is booted it installs or removes automatically. You can see now why I was looking for a firm system for setting the installed drive or path. 90% of the software installed on drive D: goes into D:\Program Files\<Softwarepublisher>\<ApplicationName>

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

Re: Changing the package Install Drive

Tue May 25, 2010 12:50 pm

Hi,

You can try setting the "Application Folder" field in Install Parameters page to:

Code: Select all

D:\Program Files\[Manufacturer]\[ProductName]
Please note that this way the package will fail on systems which don't have a "D:" drive. If you want to avoid this, you can use a custom action to modify the default path (stored in APPDIR property) on these systems.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Netflunky
Posts: 4
Joined: Sun May 16, 2010 4:37 pm

Re: Changing the package Install Drive

Tue Jun 01, 2010 3:56 pm

I have tried the D:\program Files\[Manufacturer]\[ProductName] in the "Application Folder" field in Install Parameters page, but that made no difference and I cannot see where in custom action you can change the path either. The custom Action wizard doesn't help in this instance either. There is the small possibility that the application I am testing this with an app that has this hardcoded. When I tried an install just using the applications setup it put a shortcut on the desktop. When I checked the created MSI it had the shortcut shown, but when you run the msi the shortcut does not install on the desktop. Has this anythign to do with altering from C: to D:

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

Re: Changing the package Install Drive

Wed Jun 02, 2010 9:13 am

Hi,
I have tried the D:\program Files\[Manufacturer]\[ProductName] in the "Application Folder" field in Install Parameters page, but that made no difference
Are your application files placed in the "Application Folder" directory in "Files and Folders" page? If not, then changing the default installation path doesn't do anything.
The custom Action wizard doesn't help in this instance either.
Please note that there isn't a predefined custom action for this. You would need to use custom code.
When I tried an install just using the applications setup it put a shortcut on the desktop. When I checked the created MSI it had the shortcut shown, but when you run the msi the shortcut does not install on the desktop.
I'm not sure why the shortcut isn't created. Can you please send us the .AIP (project) file you are using and a verbose log of the installation to support at advancedinstaller dot com so we can investigate it?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Netflunky
Posts: 4
Joined: Sun May 16, 2010 4:37 pm

Re: Changing the package Install Drive

Wed Jun 16, 2010 11:19 am

I eventually found another way of doing this with a computer startup script. The actuall application was on a server and all that the MSI did was to copy the registry entries across, install some dlls and active x controls.

Thanks for all your help.

Changing to D: as you descibed did work on another repackaging job. Now to try to resolve the problem I have with trying to package Windows Media Player 11. Huh

riteshmehta.guj
Posts: 3
Joined: Wed Dec 01, 2021 1:22 pm

Re: Changing the package Install Drive

Wed Dec 01, 2021 1:29 pm

Cosmin wrote:
Tue May 25, 2010 12:50 pm

Please note that this way the package will fail on systems which don't have a "D:" drive. If you want to avoid this, you can use a custom action to modify the default path (stored in APPDIR property) on these systems.

Hi There

I want to implement above functionality in my trial mode of Professional Edition.

Can you share guideline / screenshot to guide me.


My Goal is like
* I want my Installer to extract files into
D:\ first,
If D:\ not available, Extract into E:\
If E:\ not available, Extract into F:\
If F:\ not available, Extract into C:\

Kindly guide me how to achieve this in Professional Editor and if possible send me sample project.

Regards,
Ritesh Mehta

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Changing the package Install Drive

Thu Dec 02, 2021 1:40 pm

Hello Ritesh and welcome to our forums,

You can achieve this through a custom action that checks whether the drive exists and if so, set the APPDIR property accordingly.

How to set an installer property using custom actions

The custom action can be scheduled under the "Wizard Dialogs Stage" between "Paths Resolution" and "User Selection" action groups.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

riteshmehta.guj
Posts: 3
Joined: Wed Dec 01, 2021 1:22 pm

Re: Changing the package Install Drive

Thu Dec 02, 2021 2:28 pm

Thanks Catalin for update.

Can you share Sample Project file, as per my need.

Regards,
Ritesh Mehta

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Changing the package Install Drive

Fri Dec 03, 2021 11:13 am

Hello Ritesh,

Please find attached a sample project.
Ritesh - Sample project.aip
(13.55KiB)Downloaded 482 times
Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

riteshmehta.guj
Posts: 3
Joined: Wed Dec 01, 2021 1:22 pm

Re: Changing the package Install Drive

Sat Dec 04, 2021 1:00 pm

Hi There

I applied above script.

It’s working fine, if user has Regular D:\ available

But If user’s D:\ is mounted as CD Rom Drive, then below error is appearing.

"Could Not Access Network Location"

How can we handle this kind of error ?

Please advice

Regards,
Ritesh Mehta

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Changing the package Install Drive

Mon Dec 06, 2021 5:55 pm

Hello Ritesh,

I have answered you over the email.

Let's continue this thread there.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”