/build/static/layout/Breadcrumb_cap_w.png

Copy single file to C:\

I need to apply a transform to a .msi package, that includes adding a file to the rootdrive e.g. C:\file
I am using Installshield Tuner to try and do this, but there seems to be no option to add files to the root drive?
I have read various posts that advise how to chang the target dir to root, but all I want to do is add a single file, not the whole installation dir!

Any ideas on this would be appreciated.[:)]

0 Comments   [ + ] Show comments

Answers (4)

Posted by: VikingLoki 19 years ago
Second Degree Brown Belt
0
Well, the first thing I'd do is attempt to modify the application so it doesn't require a file in the root, preferably placing it in an appropriate Program Files folder, by searching the registry table or INIs for a reference to the file or c:\. You can also attempt to locally isolate the application and maybe that will cause it to look in the Program Files directory. There are several reasons to do this including security & standardization.

If you can't do that, I know in Wise there is an option which will permit you to unlock root directories so files can be added from an MSI. Check the InstallShield documentation/knowledgebase for that. If all of the above doesn't get you anywhere, you can always add the file to to the Program Files directory and at the last step of the Install Deferred MSI Script section (right before InstallFinalize) launch a custom action that will copy the file from Program Files to c:\. Be sure you qualify it with an IF NOT Remove so it isn't copied during uninstall, and add an Else to it which will delete the file during uninstalls.
Posted by: ccarmack 18 years ago
Yellow Belt
0
I thought there was a way to install a file to the root of C:\ without having to do tricks, like installing to c:\program files directory first, then issue a copy command just before InstallFinalize. Is there?
Posted by: ccarmack 18 years ago
Yellow Belt
0
Found the answer:

How do I install files directly to the root of a specific drive?

Resolution
It is often necessary to install files directly to the root of a drive. This could be the same drive where the rest of the files are going to, or a different drive. By default, Windows Installer does not have built-in support for installing files directly to the root drive, because it is uncertain until runtime what the drive is going to be. Windows Installer by default will install files to the drive that has the most available free disk space. To work around this you can use a custom action to set the directory at run time to the drive required.

Follow these steps to install files directly to the root of any drive.

1. In the Installation Expert create a directory under the destination computer, MyDir.

2. Add the files to this directory that you want installed directly to the root drive.

3. Add a custom action, Set Directory, from the MSI Script editor, Execute Immediate, and place it right after the CostFinalize sequence.

4. In the Directory field, browse and select the directory you created off of the Destination Computer folder, MyDir.

5. In the Directory Value field, enter "C:\" or whatever drive you need the files to be placed in.

6. Compile and run the msi. The files should now show up in the root of the drive you select in the Set Directory action.



Source: http://www.wise.com/KBArticle.aspx?articleno=1832
Posted by: ab2cv 18 years ago
Orange Senior Belt
0
Why not just use the [WindowsVolume] property, or am I missing something?

Alan
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ