/build/static/layout/Breadcrumb_cap_w.png

How to copy file into WindowsTemp folder rather than User temp folder

Hi

I am preparing an MSI from SetupCapture in WSP. File is being captured and placed in Temp folder.

I am having big time trouble though the task looks simple.

I want to copy the file into c:\winnt\temp folder but the file is getting copied into %Temp% folder which is c:\docuements and settings\userid\Local Settings\Temp.

I tried to with ALLUSERS=1 commandline and also with Movetable option in MSI but nothing is working out.

Please help me

Regards,
WSP

0 Comments   [ + ] Show comments

Answers (7)

Posted by: Jsaylor 14 years ago
Second Degree Blue Belt
0
Have you checked on the TempFolder entry in the Directory table? You should be able to modify the full directory value in that row to whatever temp folder you'd like. Additionally, if you're using the tables to copy files, you should use [TempFolder] instead of %temp% to copy files, that will use the path set in the database, not the environment variable on the target machine.
Posted by: WSPPackager 14 years ago
Senior Purple Belt
0
Hi Jsaylor,

thank you very much for your response.

Below is the directory table row content for TempFolder.

Directory Directory_Parent DefaultDir FullDirectory
"TempFolder" "WindowsFolder" ".:Temp" "Windows\Temp"

I could not able to edit the FullDirectory column. Could you please help me more?

Regards,
WSP
Posted by: Jsaylor 14 years ago
Second Degree Blue Belt
0
That's what it should look like, if you want it to go to c:\winnt\temp. I would guess that whatever action is copying those files is using the environment variable %temp% instead of the MSI property [tempfolder].

How are you copying the files you want in the system temp folder? With an embedded script in a custom action? If so, you may have to re-evaluate how you're populating those files, and perhaps switch them over to using the native windows installer file copying methods.

For instance, if you're using the tables, you should be able to go to the component table, find the file (or files) that you want copied, and simply change the entry in the Directory_ column to read "TempFolder". That will tell Windows Installer to put that particular file in c:\windows\temp.
Posted by: WSPPackager 14 years ago
Senior Purple Belt
0
I am using the Installation Expert wizard to copy the file. Just added the file in Windows\Temp folder and expected that the file will be copied in to the Windows Temp folder but it is not.

When I looked MSI Log, the component is having the Keypath as %temp% folder path. If we can change this to windows temp folder then I think it will copy into the windows temp folder.

Any thoughts on how to change the KeyPath value for that component.
Posted by: AngelD 14 years ago
Red Belt
0
Do you really need those files?
Files located in the temp folder are for the most temporary files.
Posted by: anonymous_9363 14 years ago
Red Belt
0
The %temp% folder is a nightmare, since its resolution depends on the installation context.

Wouldn't the simplest route be to change the Directory table entry to [%SystemRoot]\TEMP, thus using whatever the system resolves the environment variable %SystemRoot% to?
Posted by: t_claydon 14 years ago
Senior Yellow Belt
0
Add the following Row to the DirectoryTable:

Directory Directory_Parent DefaultDir
MyTempFolder WindowsFolder Temp

Then locate the Component that your file is in and change the "Directory" value to "MyTempFolder".
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