I am creating an Uninstall Tool for my application. The (.exe) is located within one of the folders that needs to be deleted.
When I try:
IO.Directory.Delete("C:\Program Files\application_folder", True)
I get an error that the program is denied because it cannot find the specified path.
Essentially, I am asking is there code or some software approach to handling how to delete the Uninstall (.exe) when it is in the folder I am deleting.
Thanks in advance!
Related
I would like to delete file (that was created by pyinstaller in C:\Users\User\AppData\Local\VirtualStore\Program Files (x86)\App\tmp )
during Uninstall (using WiX). Any idea on how to do that?
Does anybody know why pyinstaller creates that file and if I can control that?
A partial answer: That virtual store location is where Windows redirects file output when the program is not privileged enough to write to a location, and does not have an elevation-type manifest that shows it is UAC-aware. This might help:
http://sourcedaddy.com/windows-7/uac-virtualization.html
So it appears that pyinstaller assumes it is being run as administrator, but it isn't, and is writing to a location that's virtualised. Instead of trying to remove those files I'd look at that installer and how you are running it and (since it seems to require admin privilege) how to have it run with admin privilege. I assume it's old technology because an updated version would presumably include an elevation manifest saying that it requires admin privilege.
I have created an Office addin and windows installer application for it.
According to this article, addins dll'a are copied to directory like this C:\Users\Robin\AppData\Local\assembly\dl3\VBJZ5WH8.6NJ\HRZA3JXN.LVG\b0520efe\3a5b99ef_2e21cb01\GoldMail Outlook Add-In.DLL. I wish to remove those copied files during the uninstall process. Could sb please tell me how to get the full path to those copied files in C:\Users\Robin\AppData\Local\assembly\dl3\ in my installer application (actually in uninstall)? Is it saved in registry or in any other location? I have noticed, it even happens, the files are copied multiple times. Any help would be appreciated, greetings.
I have a Wix installer which is designed to install (uninstall) a Windows service and another .exe file. When I uninstall the software using this installer, and enabling extra log, I see some error messages about unable to remove my installation folder, although it is indeed empty. The first message that appears on the log is like this:
DEBUG: Error 2911: Could not remove the folder MY_INSTALLATION_FOLDER.
The following errors are all about the same problem. My first guess is of course that there are some resources that were being used during the uninstallation. However, like I mentioned, all components in this folder were indeed removed and this is an empty folder by now. Also, this error is the first error in the log, meaning there was no error prior to removing this folder. For example, from the log I can see a series of FileRemove actions were taken right prior to the folder removal and they all succeeded. So it's gotta be that this folder itself was being used. But I really can't figure out why and what is holding this folder. By the way the software was indeed uninstalled since the final product removal returns 0 and every thing related to our software was removed (Windows service list, shortcuts, registries...) excepted this empty folder. It is not crucial but we definitely don't want to hear from our customer asking about this kind of error anyway(they are using auto-installation and the log is by default enabled and checked)
Please help. Thanks!
Possible causes:
Other process is locking that folder. Use Unlocker to
verify if that's the case.
Some folders have restricted permissions
by Windows (e.g. C:\Windows\system32). Generally, you should avoid creating files under Windows own folders (unless it's required, I.e.: your'e installing a device driver).
Did you properly set folder permissions?
I have an Air app that was published as a native installer. If the user uninstalls the program it doesn't remove the folder that it was installed in. Then when the user tries to install again, it will throw an error saying that folder already exists.
ie if the program is C:/program files/my app/{contents here}
it removes the {contents here} but leaves the /my app directory.
Is there a way to make sure that folder is removed at uninstall time?
I don't think there's a way of forcing the uninstaller to delete the folder, but the reason it's not deleted is because it contains files that were not put there by the original installation. If, for exemple, you saved user profiles in your installation folder hierarchy, it won't be deleted.
You can't make sure the user won't put any files there, but at least you can avoid writing any file/folder in your installation folder from your app. Instead, use application storage folder (File.applicationStorageDirectory). You can also easily create new folders there with File.applicationStorageDirectory.resolvePath("exemple");
In the WIX I have a dialog where the user could select a folder [CUSTOM_FOLDER] from local machine, after the setup is finish I must give share to that folder and copy some files to it.
How could I archive this using WIX 3.5?
AFTER the setup is finished you want to install more files? Why not just simply install them during the process. That point aside, you can create as many empty folders as your heart desires during the installation process, then using CustomAction elements you can add the files after the installation has completed successfully. As for "give share to that folder" I have no idea what you are talking about. Please expand on that and I will try my best to answer it.