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

deployexpert created the topic: 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

applicationPackaging replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder
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.

deployexpert replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder
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

(in reply to Jsaylor)

applicationPackaging replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder
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.

deployexpert replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder
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.

applicationPackaging replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder
Do you really need those files?
Files located in the temp folder are for the most temporary files.