When trying to update Sublime Text 3 to version 3083 on a Windows 10 computer I keep getting an error message at the end of the update saying
'Unable to rename C:\Program Files\Sublime Text 3 to C:\Program
Files\Sublime Text 3 (3083), error code: 32'
I looked it up on Microsoft's website and error 32 stands for 'The process cannot access the file because it is being used by another process'.
So I tried closing down all other programs and tried updating again but I still get the same problem. I have also tried running the program as an administrator but the update creates the same error message.
I only have package control installed and the Haxe plugin installed and so I can't find any other reason why it wouldn't work, although I haven't updated it before.
Can anyone offer any advice?
All the application is trying to do is copy the new files into the sublime program folder. You can do this yourself:
Close your Sublime Text program
Open a file browser C:\Users\...\AppData\Local\Sublime Text 3\Update (or wherever your update landed)
Open another C:\Program Files\Sublime Text 3 (Make a backup of this folder if you want to be cautious)
Copy everything from the update to the Program Files folder
Run Sublime Text (you should now see the update dialog)
Remove the update folder and backup if everything looks good
For me, I found that my antivirus (Malwarebytes) was causing the issue.
(I was alerted to this because I tried to update using the installer from the website and it warned me that Malwarebytes was holding on to files it needed to complete.)
I cancelled the installer, turned off Malwarebytes, and opened sublime to let it update itself normally and it worked nicely.
It seems this is common:
https://forum.sublimetext.com/t/build-3143-flagged-as-virus/31272?u=spenceryue
I can't believe chrome.exe (Google Chrome) was using the folder where Sublime Text was installed. Removing that lock with unlocker fixed the update error.
It's not like I have ANY plugin or open tab related to sublime text on chrome.
I really recommend unlocker though, saves you more than one time.
I was troubled by this problem for some days on Windows 10, and resolved it at last.
Navicate to sublime text path, like 'C:/program files/sublime text/'
find 'update_installer.exe' and 'sublime_text.exe'
Open the file's properties - compatibility - Run as administrator...(Something like that, maybe the spelling is wrong)
Select OK, and rerun sublime text.
In my case, the reason was a package (the Powershell Editor Services package), which establishes a handle to C:\Program Files\Sublime Text 3. Those processes continued to run even after cleanly quitting Sublime Text. Killing them and removing the package that spawned them allowed Sublime Text to install its update.
I found this by using Process Explorer (procexp). Here's how:
In procexp, run "Find Handle or DLL" (ctrl+F). Type "sublime" in the search field. When I did this, I saw "C:\Program Files\Sublime Text 3" appear several times in the search results.
Click on one of the results in the search window. The process that has a handle on the folder will be highlighted in procexp's main window.
Hover over the process name. You will see a Windows hint containing the command line that invoked the process. This is the command line which ran the process which had a lock on the Sublime Text 3 folder on my machine:
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"C:\Users\YourUser\AppData\Roaming\Sublime Text 3\Packages\PowerShell\editorservices/Start-EditorServices.ps1\" -EditorServicesVersion \"0.7.1\" -HostName \"Sublime Text Host\" -HostProfileId \"SublimeText\" -HostVersion \"3.0.3170\" -LogLevel \"Verbose\" -LogPath \"c:\users\yourus~1\appdata\local\temp\1526304355-EditorServices.log\" -BundledModulesPath \"C:\Users\YourUser\AppData\Roaming\Sublime Text 3\Packages\PowerShell\editorservices\modules\""
The issue is documented here and has been resolved here. So, the team is being responsive. Hopefully the procedure described here will help others find and resolve similar issues, with other processes that leave unnecessary handles floating around.
In my case the reason was I had Sublime Text opened with another user in the same computer. I closed Sublime Text for each user and then the installer worked.
For me it was a plugin running in background called host plugin 3-8 and i ended it right away by clicking end process tree in task manager (Windows 7)
Related
I am trying to automate an installation that starts out with an InstallShield setup.exe. That kicks off the installation of a MS Visual C++ redistributable. That leads to an error about Adobe Flash not being up to date. I have asked about how to deal with that here:
Error during automated software install using pywinauto
Once I click OK for the Adobe dialog(have to use pyautogui.click() for this for now) I see that there is an .msi being extracted. I have followed the install and it puts it into a new Temp folder under my Users\AppData directory.
How do you get pywinauto to find this new application? I have tried using
adobe = Application().connect(title_re="MyInstaller",class_name="#32770", visible_only=True)
And then try to print_control_identifiers() but get this error:
AttributeError: Neither GUI element (wrapper) nor wrapper method 'print_control_identifiers' were found (typo?)
I have checked Spy++ and Inspect and AutoIT to find the class which I can. I can't use the procid as it will always change.
Any thoughts on how to attach to the .msi process so I can then connect() to it?
Edit:
Is there a way to regex pywinauto to point to a path if I know where MyProgram.msi is? It seems to be in C:\Users\me\AppData\Local\Temp{xxx}\MyProgram.msi as I found several copies there. Thanks!
Add timeout=10 or whatever you need to connect() params. Current default timeout is zero, but it should be timings.Timings.window_find_timeout which is 5 sec by default.
Auto detection of spawned child process is planned for next major release (as well as default timeout fix).
For running an unpacked .msi file you need msiexec standard Windows command in method .start(). Play with it in cmd.exe manually first starting from msiexec /?.
Here is how I deal with the fact that InstallShield exe extracts to an .msi in (into my DownloadedInstallations folder). Yes, timeout is important, but also identifying the new msi window that opens is too. (Also, I found that wait_for_idle had to be FALSE but don't remember why. YMMV :) ).
exe = pywinauto.Application(backend="uia").start(exepath, wait_for_idle=False)
Now it's going to unzip the .exe into .msi installer and that could take a while, and since the .exe window might be named the same as the .msi window must be careful not to attach to the exe window too early and must wait for the .msi window to open!! So, add an appropriate timeout in seconds. The dialog window may not exist yet here, so it's CRITICAL to use class_name of MsiDialogCloseClass especially if the title of the exe and msi are the same. This will identify the .msi window specifically, whenever it arrives.
title = "Enter Title of your App - InstallShield Wizard"
msi = pywinauto.Application(backend="uia").connect(title=title,
class_name="MsiDialogCloseClass",timeout=120)
And for the final touch, in a line I always forget, must use the title again to get the dialog window (for reasons I don't yet understand)
dlg = msi[title]
EXTREMELY HELPFUL way to view all control identifiers at this point is:
print(dlg.print_control_identifiers())
This is what hours of trial and error yielded. To continue on, now you can click buttons, like this:
dlg.Next.wait("ready",timeout=2)
dlg.Next.click()
And to click on radio buttons, this works (there may be other ways that do, but I could never find how to get a handle on the buttons by name)
dlg['I &accept the terms in the License Agreement'].wait('enabled').click()
Then moving on
dlg.Next.click()
dlg.Install.wait("enabled",timeout=5)
dlg.Install.click()
I want Sublime Text to auto reload files when they are changed in the hard disk (by some process else). Although I am not expecting to have my code open in different places, I use the editor to see resulting files, which is why this feature is crucial to my coding setup. I’ve figured out the option to prompt for the reload as below. But my issue is, it takes a long time for Sublime Text to realize the file has changed and give me the prompt. The files are in a Linux server and I am accessing them through Samba in Windows. Previously I've used Notepad++ which instantly recognize the change and prompt me to reload - so this is not to do with the file systems or hardware. Is there a way to achieve this in Sublime Text or VSCode?
"always_prompt_for_file_reload": true
I didnt change any file paths and everything was working fine. I made one quick change saved it ok, did another change and I went to save it and got the following error. How can I solve this. It will save other files ok
Unable to save
D:\xampp\htdocs\websites\dev.liverpool\style\main.scss
Error:
MoveFileEx(D:\xampp\htdocs\websites\dev.liverpool\style\.sublae1.tmp, D:\xampp\htdocs\websites\dev.liverpoolzstylezmain.scss) failed,
Access is denied.
seems it's because Windows or another program is blocking the file. Sublime text uses a temporal file instead of editing the file directly, and when you save the file uses a API command to move this edited file to the original, so this command has restrictions when one file is locked and Sublime shows this alert.
Maybe this setting {"atomic_save": false} will work for you.
Go to the path where you installed sublime text 2 and...
Right click on the sublime_text 2.exe file.
Go to its properties.
Go to compatibility section under this.
Set its privilege level to "Run this program as an administrator".
Now change settings for all users and there also check the field "Run this program as an administrator".
Apply the changes.
I just solved the same issue on Sublime Text 3 beta, Stable Channel Build 3065 by doing the following under Windows 7:
Navigate to the Sublime Text 3 executable file, wherever you have it installed.
Right-click it and select properties.
Click on the tab marked "Security"
About half way down the tab, on the right hand side, under the list of group and user names is this little button:
Click it.
If your machine is setup the way I suspect it is (otherwise you probably would not be having this issue), you should be prompted for your administrator account credentials. Enter them.
Now, select the Users group in the list, then take a look in the box at the bottom labeled 'Permissions for Users'. Put a check mark in the 'Allow' column for the 'Write' item.
Click 'Apply'
Click 'OK'
You should be set. What this does is it essentially gives Sublime the ability to write files while running with regular user privileges, no administrator level access required. Upon taking a better look at your error, what is happening is Sublime Text is creating a temp file for editing, rather than editing to file itself, then attempting to overwrite the original file with the temp on save. The problem is that the program is not being run by a user with sufficient privileges to perform the overwrite, hence the failure with an 'Access denied' message.
A simple and effective solution: Right-click on the file you want to save, in my case it is index.html, go to the properties and uncheck read-only.
The Sublime text will start working fine.
I have come across this error quite many times and by un-checking read-only file attribute of index.html, I am able to get rid of it
I found out more ways to fix this:
Close and reopen the Sublime Text windows or
Open the file with Np++, add a space, save, quit, then you're prompted by ST to reload the file, click yes, and it works again... or
Open the FTP console to see if there's a transaction in progress - then cancel it
In my case the SFTP plugin seems to be causing this problem, as when the FTP connection is timed out, the file which is waiting to be uploaded is being used, and you try to overwrite it.
This happens because you're using ScoutApp or Compass, they block your SCSS files because they are checking for changes as you specified for a directory for those files.
I suggest you reading this:
http://aspirecode.com/how-to-add-sass-support-in-sublime-text/
Good luck!
On mac using a remote volume sometimes I experience this. The solution is to remove the temp file then save again and all fixed.
IE: if you are working on test.html then the temp file would be ._test.html
Remove ._test.html then save again.
For Mac-
Try changing the destination from 'Macintosh HD' to 'Documents' or any other folder.
Worked for me.
The plugin of Superlime solved this problem. It tries to save the file as root in SublimeText.
Reference Link: https://github.com/azubr/Superlime
Try switching your SublimeText process priority to higher level in process manager (it has to have higher priority than your scss compiling app, if you're using one).
It seems to have worked for me.
if it's not working after doing all suggestions, reinstall the program
On Mac I saved the file in Home directory and it gave me this alert, later when I re saved the file again this time in Document directory the file is working now. Using SublimeText 3.
I found this occurred when the folders are read-only. Right-click on the folders where your site is contained and see if read-only is selected in the properties.
Just open it as an administrator.
Because I want to edit anything and write as admin all the time, I set this program to always open as an administrator using "Configure Applications to Always Run as an Administrator".
Just got your file folder properties which you want to save and deselect to read only attribute.
This is probably bordering off-topic-ness here, but not a lot of people on SuperUser use GVim, as opposed to here, so I'm leaving it here.
The problem is simple - I'm using GVim 7.3. from vim.org, downloaded it in the form of archived binaries (the two archive files) like always and replaced the older version. However, I can't get Windows to recognize it and to associate a file extension to it.
From windows explorer go to, let's say, .py file, Open with ... / Browse / gvim.exe in its directory and ... nothing. Like it never happened.
Does anyone have any idea what could be causing this behaviour? It's mighty annoying to have to open every file from within Vim manually.
I think the default installer ("self-installing executable") from vim.org lets you register shell associations; this means you get an entry "open with vim" in every context menu from the explorer. Did you not use this file?
I'm looking at this page and I'm thinking about this download.
This doesn't answer your question, but it's a different way to edit with gvim from the context menu.
Create a .reg file with the contents below (adjusting your path to gvim.exe) and execute it. Then whenever you right-click on a file in explorer you will have an "Open with GVIM" option.
REGEDIT4
[HKEY_CLASSES_ROOT\Unknown\shell]
#="Open with GVIM"
[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell]
[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with &GVim]
#="Open with GVIM"
[HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with &GVim\command]
#="C:\\Vim\\gvim.exe \"%1\""
I gave up trying all kinds of tricks through the registry, but this solution works for me just fine. I might add, I'm having the same issue on Windows 7. Since Windows seems to be able to do the association with vim.exe just fine, and this is apparently tied to the file name, I moved vim.exe off as say vim.ex$ and made a copy of gvim.exe to vim.exe. Cheap and easy way around this goofy problem, and I can't say I ever use vim.exe on purpose.
I have PHP for FastCGI installed on Windows 7 through the Web Platform Installer. I need to edit php.ini to enable logging, but I'm not able to overwrite the existing file, apparently because something has it open and/or locked.
Stopping the server in IIS Manager doesn't help; stopping the Windows Process Activation Service and the World Wide Web Publishing Service doesn't help. phpinfo() confirms that I'm working with the correct file (C:\Program Files (x86)\PHP\php.ini). It's not marked as read only and I do have permissions for it. I'm out of ideas.
I had this problem and managed to work around it. You need to be running the editor (notepad or whatever) as an admin.
In Window Vista / Window 7, right click and choose "Run as Administrator".
Then open php.ini and edit it...
Another option is to copy the text of the file into a new file in a different location, make your changes, save the file as 'php.ini'. Then copy the new file across overwriting the old one. Explorer may handle the permissions differently.
I've had a similar problem, and I was working in windows 10 which doesn't use "run as administrator"
So this is what I did:
right click the problem file and go to properties
go to tab security
click edit, which should have a shield
select in names of groups: Users(computer specifics\Users)
in the square under it you can allow editing of the file
This causes it to allow you to edit the file for users and not run into the problem anymore. This also removes the problem in the future for this file so you can always edit it again by just opening the file in text editor.
Please note I am Dutch and that certain names are translated incorrectly.
You could use the Find Handle feature of Process Explorer (direct EXE download link), from Sysinternals (a part of Microsoft now), to find out what exactly is locking the file.
I'm sorry I can't help with your exact question, but hope that helps!
In Windows 7, right click Notepad and choose "Run as Administrator". Make sure you do not use Notepad++ as your editor. It accesses this file and therefore tells you there's is an error.
The default notepad will work fine with these instructions.
Depending on what are you trying to write to the file, you can write to an '.htaccess' file on the root of the site instead. I can provide a more specific example if you would like.
You can also use Unlocker to figure this out. A pain, but the utility is really handy anyway so it won't hurt to have it around.
1) Open CMD with administrator mostly like this.
2) Then go to "C:\Program Files\php-8.1.7" like this.
3) then paste "cd C:\Program Files\php-8.1.7" and press Enter and type
php.ini like this.
4) It will automatically open the file in a text editor or suggest to
open any editor like notepad , notepad++,vs code etc.
5) edit as you wish and save it like (ctrl + s) .Here I adding MongoDB
extension like this .And that's it.
By the way the question was asked 12 years ago but we still facing the problem
Try this:
Stop the webserver
Change the file
Start the webserver
If that doesn't work, then you are probably changing the wrong file. It's possible that the original file is elsewhere and when the server starts it copies it to C:\Program Files (x86)\PHP\php.ini. phpinfo() might be pointing to the file that is overwritten every time...