Fuzzy searching path in autohotkey - path

Since I am using jetbrains product and their update change the filepath of the installation directory, I have to keep updating the executable path. Is there a way to do a fuzzy search?
For example instead of having to change:
Run "C:\Program Files\JetBrains\WebStorm 2016.3.2\bin\webstorm.exe"
Run 'C:\Program Files\JetBrains\WebStorm 2017.1.1\bin\webstorm.exe"
I want to just do:
Run 'C:\Program Files\JetBrains\WebStorm*\bin\webstorm.exe"

Executes C:\Program Files\JetBrains\WebStorm*\bin\webstorm.exe
Loop C:\Program Files\JetBrains\WebStorm*, 2
Run %A_LoopFileFullPath%\bin\webstorm.exe

Related

How to run 2 .exe files using registry keys

The idea here is to make 2 .exe files run when I open only 1 of them.
I have 2 files:
F:\Gry\Riot Games\League of Legends\LeagueClient.exe
C:\Program Files (x86)\Overwolf\OverwolfLauncher.exe
When I launch LeagueClient.exe I'd like OverwolfLauncher.exe to run alongside it. Is there a way to do it?
I don't think you'll be able to modify the LeagueClient without running with any issues with the anticheat, I believe creating a bat file would be what you want.
#ECHO off
start F:\Gry\Riot Games\League of Legends\LeagueClient.exe
start C:\Program Files (x86)\Overwolf\OverwolfLauncher.exe

GDAL, ogr2ogr "Cannot find proj.db" Error

I've tried to extract certain country from the world shp file from natural earth.
I am currently using windows 10, so I installed python 3.7, gdal to use the ogr2ogr.
I typed the below code in the command to extract the south korea
ogr2ogr -f GeoJSON -where "geonunit='South Korea'" korea-geo.json
ne_10m_admin_1_states_provinces.shp
But the below errors are coming out.
ERROR 1: PROJ: proj_create_from_wkt: Cannot find proj.db
ERROR 1: PROJ: proj_identify: Cannot find proj.db
I already set up the environmental variables for Gdal..
C:\Program Files\GDAL\gdal-data
C:\Program Files\GDAL\gdalplugins
Please guide me to solve this problem.
Check your environment_variable:
setx GDAL_DATA "C:\Program Files\GDAL\gdal-data"
setx GDAL_DRIVER_PATH "C:\Program Files\GDAL\gdalplugins"
setx PROJ_LIB "C:\Program Files\GDAL\projlib"
setx PYTHONPATH "C:\Program Files\GDAL\"
Adding PROJ_DEBUG=3 to your environment_variable is very useful. The error message will then tell you where PROJ is expecting the file.
You might need to set the PROJ_LIB environment variable. But I'm not sure where that data lives on your system. It could also be affected by how you installed GDAL.
If you go into your C:\Program Files\GDAL directory, do you have a folder called proj? If so, see if it has proj.db file in it. If it does, that's your PROJ_LIB path value. You might also find it in some kind of share folder.
If you don't find it nested somewhere in your GDAL directory, try searching your system for the proj.db file, and ,if you find it, set that directory (NOT the full file path) as your PROJ_LIB value, reboot, and see if things start working.
Add these commands to your code at the beginning before importing GDAL. Your issue will be solved.
import os
os.environ['PROJ_LIB'] = 'C:\\Users\\Sai kiran\\anaconda3\\envs\\sai\\Library\\share\\proj'
os.environ['GDAL_DATA'] = 'C:\\Users\\Sai kiran\\anaconda3\\envs\sai\\Library\\share'
import gdal
Search for the location of your proj.db file in your anaconda directory and replace the same location with C:\\Users\\Sai kiran\\anaconda3\\envs\\sai\\Library\\share\\projin the above command. Also, replace the location of gdal folder in the anaconda directory as in the above example.

neo4j-admin import: Directory of import\movies5b.csv doesn't exist

I tried to follow this example. But somehow it cant access or find the import directory or the files located in it.
C:\Program Files\Neo4j EE 3.2.2\neo4j-enterprise-3.3.2\bin>neo4j-admin import --nodes import/movies5b.csv --nodes import/actors5b.csv --relationships:ACTED_IN import/roles5b.csv
Directory of import\movies5b.csv doesn't exist
I only did copy paste. This is my path to movies5b.csv C:\Program Files\Neo4j EE 3.2.2\neo4j-enterprise-3.3.2\import. I copied the name and I cant find any typos. I can open all csv's and they contain everything they should. I started the command prompt as admin. There are no changes in the log. Neo4j isnt started. NEO4J_HOME is set to C:\Program Files\Neo4j EE 3.2.2\neo4j-enterprise-3.3.2.
With this neo4j-admin import, path are relative to where you execute it.
Because you execute it under the bin folder, the tool can't find your csv.
Try to prefix your CSV path with ../ or (..\ for windows ?) or run the same command but from the Neo4j home directory

Apache Ant 1.9.6 will not run on Windows 7

Because I was having problems, I opened a command window and changed to the very bin directory where ant was installed. Then I entered 'ant -version'. It returned:
Files\Java\jdk1.8.0_72"" was unexpected at this time.
Entering 'ant' alone gives the same message. The JAVA_HOME is set to the jdk folder (jsk1.8.0_72), and the PATH adds \bin to it. Nothing else appears broken.
Any ideas gratefully received. Thank you.
Since writing the above, I tried shifting to 32-bit jdk7 from 64-bit jdk8. Output from "ant --version" changed a bit to: Files was unexpected at this time.
Changing the Symlinks in C:\ProgramData\Oracle\Java\javapath did nothing good.
Output of "set | findstr /b /i //"java_home=//"" is:
JAVA_HOME="C:\Program Files (x86)\Java\jdk1.7.0_79"
For PATH=, the output is too long and characters could be missed, so instead I ran: echo %PATH% > d.txt. Here is the result:
C:\Program Files\Everything;C:\Program Files\gradle-2.8\bin;"C:\Program Files (x86)\Launch4j";C:\Program Files (x86)\Apache\apache-ant-1.9.6\bin;"C:\Program Files (x86)\Java\jdk1.7.0_79"/bin;C:\cygwin64;C:\cygwin64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Windows Resource Kits\Tools\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\curl;C:\Devkit\bin;C:\Ruby21-x64;C:\Ruby21-x64\bin;C:\Perl64\site\bin;C:\Perl64\bin;C:\Program Files (x86)\Apache\apache-ant-1.9.0\bin;"C:\Program Files (x86)\Java\jdk1.7.0_79"\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\GNU\GnuPG\pub;C:\Program Files (x86)\WinMerge;C:\Program Files (x86)\Bazaar;C:\Program Files\jEdit;C:\Program Files (x86)\Groovy\Groovy-2.1.7\bin;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files (x86)\Calibre2\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\CMake\bin;C:\Program Files (x86)\mingw-w64\i686-4.9.2-posix-dwarf-rt_v4-rev2\mingw32\bin;C:\Program Files (x86)\Scite\scite\bin;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Tcl\bin;C:\Program Files (x86)\Arduino\hardware\tools\avr\bin;C:\Program Files\dbd\Beard;C:\Program Files\dbd\dd;C:\Users\dbd\AppData\Roaming\npm
Please note that all the Java Demos run OK, suggesting that the basic java installation is OK.. Have not yet looked at the Registry. All of this is mysterious and upsetting.
Thanks to Stefan De Laet and Chad Nouis. More to be done.
This entry in your PATH doesn't look quite right:
"C:\Program Files (x86)\Java\jdk1.7.0_79"/bin
Those quotation marks shouldn't be there. Also, the forward slash before bin should be replaced with a backslash:
C:\Program Files (x86)\Java\jdk1.7.0_79\bin
Next, the JDK directories appear twice in your PATH:
...;"C:\Program Files (x86)\Java\jdk1.7.0_79"/bin;...;"C:\Program Files (x86)\Java\jdk1.7.0_79"\bin;...
Only one JDK directory is necessary. I recommend deleting the second entry.
Further, your JAVA_HOME also shouldn't have quotation marks. The following...
JAVA_HOME="C:\Program Files (x86)\Java\jdk1.7.0_79"
...should be...
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_79
At long last and finally, 'ant -version' gets the correct response: "Apache Ant(TM) version 1.9.6 compiled on June 29 2015". I beiieve several things contributed to the success:
Switching from 64-bit to 32-bit java. Since Ant comes as a zip file, I could not discover whether it is really 64-bit or 32-bit. I did find it in my 32-bit folder, but that could be a holdover from earlier times. But maybe not.
fixing the PATH. The PATH which I sent was an end-result after substitution composed of a replacement for the following: "...%JAVA_HOME%/bin...". Normally, I would have spotted it, but because of the %, I did not. Thank you Chad Nouis! When I switched to 32-bit, I did not touch the PATH entry, but merely changed JAVA_HOME. This may have been in the system for some time.
Oh Well! Have a good day everyone and thanks again!

How do you install an MSI with msiexec into a specific directory?

I want to install an MSI file with msiexec into a specific directory. I am using:
msiexec /i "msi path" INSTALLDIR="C:\myfolder" /qb
Using "INSTALLDIR" is not working properly because the MSI is installed into the default path and not into the specified path.
Use TARGETDIR instead of INSTALLDIR. Note that the quote marks for TARGETDIR property are only around the path in the case of spaces.
msiexec /i "msi path" TARGETDIR="C:\myfolder" /qb
Source: https://learn.microsoft.com/en-us/windows/win32/msi/targetdir
InstallShield 12
INSTALLDIR represents the main product installation directory for a
regular Windows Installer–based (or InstallScript MSI) installation,
such as the end user launching Setup.exe or your .msi database.
TARGETDIR represents the installation directory for an InstallScript
installation, or for an administrative Windows Installer based
installation (when the user runs Setup.exe or MsiExec.exe with the /a
command-line switch).
In an InstallScript MSI project, the InstallScript variable
MSI_TARGETDIR stores the target of an administrative installation.
Source: INSTALLDIR vs. TARGETDIR
Use INSTALLLOCATION.
When you have problems, use the /lv log.txt to dump verbose logs. The logs would tell you if there is a property change that would override your own options.
If you already installed the product, then a second run might just update it without changing the install location. You will have to uninstall first (use the /x option).
msiexec /i "msi path" INSTALLDIR="C:\myfolder" /q
Only this variant worked well.
In my case all of them did not work and finally it was
msiexec /i "msinamebla.msi" INSTALLFOLDER="C:\test\" /qb
I checked the log.txt as described by ezzadeen and found "INSTALLFOLDER" in there.
Actually, both INSTALLPATH/TARGETDIR are correct. It depends on how MSI processes this.
I create a MSG using wixToolSet. In WXS file, there is "Directory" Node, which root dir maybe like the following:
<Directory Id="**TARGETDIR**" Name="SourceDir">;
As you can see: Id is which you should use.
This should work:
msiexec /i "msi path" TARGETDIR="C:\myfolder" /qb
Use APPLICATIONFOLDER="path" for latest msiexec
for my msi, I had to set DEFAULTPATHC="D:\myfolder" because later in the installation process, both INSTALLDIR and TARGETDIR were reset to reflect the value in DEFAULTPATHC
This one worked for me too
msiexec /i "msi path" INSTALLDIR="D:\myfolder" /q
I had tried two other iterations and both installed in the default
C:\Program Files
INSTALLDIR="D:\myfolder" /q got it installed on the other drive.
I tried TARGETDIR, INSTALLLOCATION and INSTALLDIR args and still it installed in the default directory.
So I viewed the log and there is this arg where it sets the Application Directory and it is being set to default.
MSI (s) (50:94) [09:03:13:374]: Running product '{BDAFD18D-0395-4E72-B295-1EA66A7B80CF}' with elevated privileges: Product is assigned.
MSI (s) (50:94) [09:03:13:374]: PROPERTY CHANGE: Adding APPDIR property. Its value is 'E:\RMP2'.
MSI (s) (50:94) [09:03:13:374]: PROPERTY CHANGE: Adding CURRENTDIRECTORY property. Its value is 'C:\Users\Administrator'.
So I changed the command to have APPDIR instead of the args mentioned above. It worked like a charm.
msiexec /i "path_to_msi" APPDIR="path_to_installation_dir" /q
Add /lv if you want to copy the installation progress to a logfile.
If you've used Advanced Installer to build your .msi you will want to use APPDIR=
Here's my attempt to install .msi using msiexec in Administrative PowerShell.
I've made it 7 times for each of 2 drives, C: and D: (14 total) with different arguments in place of ARG and the same desirable path value.
Template: PS C:\WINDOWS\system32> msiexec /a D:\users\username\downloads\soft\publisher\softwarename\software.msi /passive ARG="D:\Soft\publisher\softwarename"
ARGs:
TARGETDIR
Works OK-ish, but produces redundand
ProgramFilesFolder (with an additional folders similar to the
default installation path, e.g.
D:\Soft\BlenderFoundation\Blender\ProgramFilesFolder\Blender Foundation\Blender\2.81\) and a copy of the .msi at the target
folder.
INSTALLDIR, INSTALLPATH, INSTALLFOLDER, INSTALLLOCATION, APPLICATIONFOLDER, APPDIR
When running on the same drive as
set in the parameter: installs on this drive in a default folder
(e.g. D:\Blender Foundation\Blender\2.81\)
When running from a
differnet drive: seems to do nothing
You may try ARPINSTALLLOCATION (docs).

Resources