Problems during Unistall.
Hi,
During uninstall, i also have to remove some user data files saved in the windows user profile. I have achieved this by deleteing the files through a custom installer class. When the installation happens to be a per-machine installation, i have to delete the files from all the windows user's profile in the local machine. i can get the list of user profiles from registry. How can i get which type of installation occurs, from the Custom Installer class,ie., how can i get the value of [ALLUSERS] value from the custom installer class.
During uninstall, i also have to remove some user data files saved in the windows user profile. I have achieved this by deleteing the files through a custom installer class. When the installation happens to be a per-machine installation, i have to delete the files from all the windows user's profile in the local machine. i can get the list of user profiles from registry. How can i get which type of installation occurs, from the Custom Installer class,ie., how can i get the value of [ALLUSERS] value from the custom installer class.
0 Comments
[ + ] Show comments
Answers (11)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
Do you mean that, during an uninstall, you want to detect how the package was installed, per-machine or per-user?
EDIT:
Actually, it's irrelevant. Just use the RemoveFile table. Leave the FileName cell empty and the folder will be deleted. If you add both the User profile and All Users profile folders, it'll be quite safe, in terms of uninstall since the entries will be ignored if the folder doesn't exist.
EDIT:
Actually, it's irrelevant. Just use the RemoveFile table. Leave the FileName cell empty and the folder will be deleted. If you add both the User profile and All Users profile folders, it'll be quite safe, in terms of uninstall since the entries will be ignored if the folder doesn't exist.
Posted by:
maha2804
14 years ago
Well.. let s take the worst case. I m a user with no admin privelages. I m trying to uninstall my per user installation. No wif i try to delete the folder from some other user, exception will be thrown. The deletion of user dat of all the user logged in the machine can be done only by a admin who has performed a per machine installation.
Posted by:
guy.forum
14 years ago
Hello....
As per your first post regarding the deletion of folders during uninstall , i would suggest that it can be an alternative if you call a vbscript during uninstall.
The Script functionality can be:
1.) Traversing the folders like
Set objShell = CreateObject("WScript.Shell")
Dim Syspath,SyspathFolder, sysroot
Syspath = objShell.ExpandEnvironmentStrings("%systemdrive%")
sysroot = objShell.ExpandEnvironmentStrings("%systemroot%")
SyspathFolder = Syspath & "\Documents and Settings"
Set objFolder=objFSO.GetFolder(SyspathFolder)
Set objFolders=objFolder.SubFolders
For Each folder In objFolders
' Your desired operations here.
Next
In This way you can delete all the required files/folders from Uninstallation from all the users profile.
Hope this will help you!!
Thanks[:)]
As per your first post regarding the deletion of folders during uninstall , i would suggest that it can be an alternative if you call a vbscript during uninstall.
The Script functionality can be:
1.) Traversing the folders like
Set objShell = CreateObject("WScript.Shell")
Dim Syspath,SyspathFolder, sysroot
Syspath = objShell.ExpandEnvironmentStrings("%systemdrive%")
sysroot = objShell.ExpandEnvironmentStrings("%systemroot%")
SyspathFolder = Syspath & "\Documents and Settings"
Set objFolder=objFSO.GetFolder(SyspathFolder)
Set objFolders=objFolder.SubFolders
For Each folder In objFolders
' Your desired operations here.
Next
In This way you can delete all the required files/folders from Uninstallation from all the users profile.
Hope this will help you!!
Thanks[:)]
Posted by:
maha2804
14 years ago
Posted by:
anonymous_9363
14 years ago
Well my question is not how to delete the files.Really? You could have fooled me:
During uninstall, i also have to remove some user data files saved in the windows user profile
- You already know that a non-admin user cannot remove any other user's data, so it's irrelevant whether or not the install was per-user or not. That user can delete his/her own data files (post #3)
- If you use an admin-level account to uninstall, it's equally irrelevant how it was installed. The contents of the RemoveFile table will take care of files which were installed either way.
Posted by:
maha2804
14 years ago
You already know that a non-admin user cannot remove any other user's data, so it's irrelevant whether or not the install was per-user or not. That user can delete his/her own data files (post #3)
For a non admin user it is obvious the installation is going to be per user.
If you use an admin-level account to uninstall, it's equally irrelevant how it was installed. The contents of the RemoveFile table will take care of files which were installed either way.
It is relevant how it is installed. An admin user can choose to install the application per-user. Then during uninstallation the installer shouldnt not be meddling with other user profiles just becouse it has admin privelages.
So the ambiguity of the situation can be solved by getting the type of installation in the custom installer class.
Posted by:
dvdzonenz
14 years ago
Posted by:
maha2804
14 years ago
May be. The application can either be installed per-user or per-machine. So if the application is a per-machine, then during unistallation i hv to delete the setting files of alll users logged in to the computer.
How do i find whether the installation is per-user or per-machine from Installer class.??
How do i find whether the installation is per-user or per-machine from Installer class.??
Posted by:
dvdzonenz
14 years ago
To simplify it I would limit the machine to people who all use the same programs and nothing gets uninstalled.
As for your case I would check the local profile variable etc. Because If I install a certain program as per machine then it got installed in c:\windows... etc normally it is installed in the user's folder. The program is chrome and it gets installed in
"C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application\" PER USER base
and on the the final machine it got installed in
C:\WINDOWS\system32\config\systemprofile\Local Settings\Application Data\Google\ PER MACHINE.
I don't know much about msi internals. I told you what I know till now. I can see that the msi knows the current username when I install as per machine base. I am not sure where would it go if a user decided to install it per machine base.
HTH
As for your case I would check the local profile variable etc. Because If I install a certain program as per machine then it got installed in c:\windows... etc normally it is installed in the user's folder. The program is chrome and it gets installed in
"C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application\" PER USER base
and on the the final machine it got installed in
C:\WINDOWS\system32\config\systemprofile\Local Settings\Application Data\Google\ PER MACHINE.
I don't know much about msi internals. I told you what I know till now. I can see that the msi knows the current username when I install as per machine base. I am not sure where would it go if a user decided to install it per machine base.
HTH
Posted by:
anonymous_9363
14 years ago
Posted by:
dvdzonenz
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.