Copying a file directly to User Profile through wsi
Updated: 21 May 2010 | 16 comments
This issue has been solved. See solution.
Hi All,
I need to copy a file directly to User Profile (C:\Documents and Settings\<currentuser>) or (%USERPROFILE%) through Wise Pacage Studio (WSI File).
Any Technique or best practice without using any Scripts (VBScript and Wise Script).
discussion Filed Under:
Comments
Use Set Directory custom action
Use a Set Directory custom action, to set a directory reference to the path in the [%USERPROFILE] environment variable, and point your files to install to that location.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Ed, judging by the question,
Ed, judging by the question, I don't think the poster would know what a Custom Action is (no offence, Raju!).
Raju, let's assume you want to copy a file to [%USERPROFILE]Application Data\Acme Software\Data.
- In WPS's 'Installation Expert' view, click the 'Files' item.
- In the lower, left-hand pane, double-click the 'Windows' folder, then the 'Profiles' folder, then the 'Application Data' folder.
- Now, in the upper left-hand window, browse to 'C:\Documents and Settings\[username]\Application Data'.
- Select the 'Acme Software' folder
- Click 'Add Contents'
- Click 'OK'
If you had wanted to create a folder somewhere in there, click the 'New' button, enter a folder name, then click 'OK'.
Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.
For your information, Eshwar
For your information, Eshwar wrote a vbscript for this purpose.
If you would like to take a look at it, please go through the following link:
https://www-secure.symantec.com/connect/downloads/script-copy-filesfolders-all-user-profiles-machine
Thanks,
Anji
Not quite.
Not quite. That script copies a file into the profile folder of all users who have logged in to a machine. Also, you'll note that the OP (wisely) doesn't want to use script.
Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.
Benefit of doubt
I don't like to assume a skill level for a poster. However, as you seem to have a lot of spare time on your hands Ian, I'm glad to see you are able to expand on the detail. ;-)
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
I have plenty of time at the
I have plenty of time at the moment, as I'm sitting through a bunch of SAS package compiles. 7,662 files totalling 2.11Gb. Wise just laps up apps like that...
Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.
SAS has shrunk
Yes, good old SAS - I remember packaging that with Wisescript Editor back in 1999, when it had over 20000 files and needed to be split into 4 separate installs because Wise would barf trying to compile 20K+ files into one EXE.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
To VBScab and EdT
Thanks for your replies.
@VBScab - If I follow your directions which you mentioned above, I dont think it will work because If you do that - It will pick up like this - C:\Documents and Settings\[xxxxxID]\File (If you double click on that file from WPS and see the source path) and when you install the MSI, it will will copy the file to C:\Documents and Settings\xxxxID\File.
But when next user logins - it wont copy the file to that logon user (current user) that means it wont copy the file to the user profile (%USERPROFILE%)even if you setup active setup procedure.
@VBScab - Ed, judging by the question, I don't think the poster would know what a Custom Action is (no offence, Raju!) -
Cool:-) So, you mean to say that - I dont know what a Custom Action is??
Thanks to EdT for replying like this - I don't like to assume a skill level for a poster. I feel the same:-)
Let me try Edt's Option - Use Set Directory custom action.
Thanks alot for sharing the knowledge!!
Source path: You mean, you
Source path:
You mean, you don't have WPS set to copy files to a path relative to the Projects folder? Do that and then change WPS's source path to '.\Windows\Profiles\[whatever]'. Alternatively, browse to the folder beneath the Projects folder, where WPS copied the source, and use that.
Target:
if you drop the folder as directed, it *will* be copied to the logged-in user's profile. The 1000s of apps I've packaged tell me that I might be right.
Skill level:
Apologies but it's a pretty basic question for someone who knows what a CA is.
Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.
I have a file which needs to
I have a file which needs to copy to the %UserProfile% directly (C:\Documents and Settings\xxxID).
Copying a file directly to the UserProfile folder (not to any AppData folder or any other folder under UserProfile).
In your points -
- In WPS's 'Installation Expert' view, click the 'Files' item.
- In the lower, left-hand pane, double-click the 'Windows' folder, then the 'Profiles' folder (NOT TO Application Data Folder)
- Now, in the upper left-hand window, browse to 'C:\Documents and Settings\[username]
- Select the 'Acme Software' folder
- Click 'Add Contents'
- Click 'OK'
All that above meaning is - you are suggesting to add a file directly to Windows/Profiles from the Files part on Installation Expert right?? If I follow that, the file is going to show in that particular user only.
But I wanted to see the file who ever logs in to that machine. Ex. if somebody logs in to that machine - then, the file should show up in his/her userprofile. That means - The file has to copy to that %UserProfile%.
In your case - I am 100% sure, it wont showup on every user profile who ever logs into that box.
Somebody above mention that through scripts can solve this - I know that solution but I want to do this without using scripts.
Thank you again!!
[sigh]
I don't know how many times you want me to tell you how to do this. Let me try once more:
Use the 'Profiles' folder and it WILL resolve to the logged-in user's profile at deployment time.
Whatever. Do what you want. Cheerio.
Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.
You will need to have the source file available
You also need to think about how you are going to make the source file available to copy into each user's profile.
Would be helpful to place the file into the Program Files folder along with other application files, and then install it from there using the duplicate files table. Make sure your user feature is the master feature of your project and place the "complete" feature as a child of the user feature. Self healing will then ensure that the user feature gets repaired even if it doesn't have an advertised entry point in it.
Use a HKCU regkey as the key path for the component. Use the Set Directory custom action to set the destination folder for the component. Use the duplicate files table to copy the file from its program files location to the user profile location.
(In installation expert - if you add a file to the program files location, then the same file to the user profile location, and entry should be made in the duplicate files tables linking the program files location with the user profile location for that file).
That way, self healing for the file does not need to call back to the installing MSI.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
But the point here is - the
But the point here is - the whole package itself is one file which means installing the package is just does copy the file into userprofile and there are no reg keys either HKLM or HKCU except Active Setup under HKLM. (there is no other files or program files folder related to the application).
Thank you!!
You didn't make this clear
Your original posting did not make it clear that you are only installing one file - just that you need to install a file to the user profile - so it could have been part of a larger install.
As it's a single file with no advertised entry points, the use of Active Setup is pretty much the simplest way forward.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
I didnt know if this is the best practice.
Since the Active Setup didn't work.
-> I have imported the file to Windows->Profiles->All Users->Application Data folder in WSI.
-> Created a VBScirpt which copies a file from Windows->Profiles->All Users->Application Data to %UserProfile% in the installation process.
-> Applied the VBScipt as a Custom Action after installing the file to Windows->Profiles->All Users->Application Data to make sure the file is there to copy %UserProfile%
->Also implemented Active Setup
I tried VBScab (Used Profile Folder) and EdT (Active Setup) - It didn't work. I know it sounds funny:-) but it didn't.
So, I have try the above to workit out some how (Keeping the file in All Users and from there copying to UserProfile using VBScript and also active setup implemented).
Anyway thanks a lot for your time!!
I can't see why Active Setup
I can't see why Active Setup wouldn't work. If you have your StubPath data value set correctly, then you should have no issues installing files to the %USERPROFILE% location.
I generally use this value to get user files and registry entries installed: msiexec /fpodcu [ProductCode] /passive /norestart
Would you like to reply?
Login or Register to post your comment.