stefankueng / grepWin

A powerful and fast search tool using regular expressions
https://tools.stefankueng.com/grepWin.html
GNU General Public License v3.0
1.76k stars 182 forks source link

change working directory on start #394

Closed jdknight closed 1 year ago

jdknight commented 1 year ago

When launching from a context menu, the working directory will be set to the folder grepWin has been invoked from. With the process now having an association with this directory, actively attempting to manipulate (e.g. move/delete) will fail due to an "in use" error. For example:

  1. Create a new directory on the file system
  2. Navigate into that directory
  3. Right-click and select "Search with grepWin"
  4. Attempt to delete the folder and observe that it fails:

image

To allow users to freely manipulate their file systems (without having to close grepWin), change the working directory to the install path of grepWin on start.

mlipok commented 1 year ago

sorry for asking so late. How this will work with PORTABLE version on a system where grepWin was never installed ?

jdknight commented 1 year ago

How this will work with PORTABLE version on a system where grepWin was never installed ?

I would imagine there would be no negative change for a portable version. Internally, grepWin will set its working directory to the folder holding grepWin.exe.

I took a development build and nested in into a portable folder to observe any oddities. With and without the change, I did not see any differences/issues from the limited testing performed (but if there is something specific you want me to look for, please let me know).