/build/static/layout/Breadcrumb_cap_w.png

Delete folder and file in personalfolder during uninstallation

Hello, teachers,

I searched many posts but they all looks "foreign language" for me as a beginner.
So, please understand if my question is stupid. [&:]

1. My msi packages has no problem to install/uninstall in Admin account leaving nothing.
2. I installed my msi using runas with admin right, then again no problem during installation.
I can launch program, edit data folder under "PersonalFolder" --> simply no problem
3. However, when i deinstall my msi in runas, msi finishes leaving data folder under "PersonalFolder"
Fyi, I don't know if it is related but "PersonalFolder" is pointing to user Home folder and mapped with network drive in the server.

>> I want to delete this data folder under "PersonalFolder" << How can I do it.
Someone says that we can delete them using second MSI. I have only one msi from the vendor.
1. how do i create dummy msi (?) with what action?
2. how do i link this dummy msi with vendor msi?
3. what is the sequence between them

>> any other easy way?

Thanks so much in advance.....
It has been 4 days since I am stuck. I am going to hate packaing [:(]

0 Comments   [ + ] Show comments

Answers (9)

Posted by: knight 16 years ago
Orange Senior Belt
0
Hi faithkim,

You can use a PROPERTY VALUE using REGSEARCH to point on the current log on user (HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName). Use that PROPERTY in REMOVEFILE table to delete the directories and files.

But if the PERSONALFOLDER you are saying is map on the network drive, try to create a custom action script that will remove the folder. In most cases, PERSONALFOLDER are referred to as MY DOCUMENTS.

I hope this one helps [:)]

knight
Posted by: anonymous_9363 16 years ago
Red Belt
0
Is the MSI creating that folder, or placing any files in that folder? I suspect not, otherwise it would be removed completely. What I imagine is happening is that the application is ADDING files into that folder and, since the MSI didn't create them, it has no knowledge of them and will thus leave them alone. Ipso facto, the folder remains. I'd guess that, if the MSI installs SOME of the files therein, on uninstall only those files get removed?

Whatever action you decide on, you should NOT edit vendor MSIs (you don't state whether these are vendor-supplied or self-authored), but create a transform for your changes.

So, the solutions are either:
- as Rhandy (Knight) says, create a Custom Action to remove the folder;
- add the files (as dummies, if need be - zero-byte files are handy here) to the transform;
- add the folder to the RemoveFile table and select it to be removed on uninstall.
Posted by: faithkim 16 years ago
Senior Yellow Belt
0
Thanks for the advice!

In fact, I used CA but it still doesn't remove data in personalfolder.(CA works fine in admin mode)
I talked with my colleague in company and he says that it is not possible??
what he advised me is to have main Msi and 2nd Msi to remove user folder under personalfolder. Main Msi runs in admin right using SMS and 2nd Msi runs in normal user right using SMS. --> So currently I am doing so.

For the CA, is there any tricks that i can give user right? (remember that it works fine in admin mode).
I didn't try transform but will this be a solution?
Posted by: India_Repackaging 16 years ago
Blue Belt
0
Hi Kim,

I completely agree to VBScab's comment when he says that a transform is to be created while working with Vendor supplied msi files. Please do not edit them as then you may run into more trouble.
Coming to your problem,
1. Include the files/folder in your package through the .msi/.mst. Once you do this on uninstallation it will be removed as it is now a part of the package. if there are a lot number of files and folders created on run time I suggest resorting to point 2 (Unless you have no issues adding a script into you package)

2. Or you may add a custom action using a VBScript to forcibly remove the files and folders on uninstallation. Please make sure that you use this only during uninstallation (condition REMOVE~='ALL" e.g.). Make sure the placement of the CA is appropriate.

I also dont think there would be any premission issues for deleting the files and folders.
Posted by: anonymous_9363 16 years ago
Red Belt
0
Where is the 'user folder under personalfolder'? Is it on the local hard drive or is it redirected to a network share? Is the CA set to run in User context of System context?
Posted by: faithkim 16 years ago
Senior Yellow Belt
0
Hi, VBScab,
The personal foder is redirected to network share (Home folder).
Would you let me know how I can set CA to run in User context? and from your comment, I guess CA runs in System context as default right?

Ps) I didn't try transform yet, sorry for the contributors above.
Posted by: faithkim 16 years ago
Senior Yellow Belt
0
Hello Knight,

For the people like me(beginner),
In my PC environment, [Logon user] value is not logonuser.
So, I had to use HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName, instead of HKCU.

thanks Knight anyway & VBScab
Posted by: anonymous_9363 16 years ago
Red Belt
0
ORIGINAL: faithkim
For the people like me(beginner),
In my PC environment, [Logon user] value is not logonuser.
So, I had to use HKCM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName, instead of HKCU.
HKCM? Do you mean HKLM? :)
If you did, that's the default user name meaning that, if someone other than the normal user logs in on that w/s, his/her name will appear here. BTW, as a security measure, this should be blanked. IIRC, there's a Group Policy setting for that.

Use HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Logon User Name. Somewhat more reliable, maybe... :)
Posted by: anonymous_9363 16 years ago
Red Belt
0
ORIGINAL: faithkim

Hi, VBScab,
The personal foder is redirected to network share (Home folder).
Would you let me know how I can set CA to run in User context? and from your comment, I guess CA runs in System context as default right?

The System user has no access to the network, that's why I asked.
As to having your CA run in User Context, your authoring tool should have an interface to do that. What tool are you using?
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