How to move the adbkey file path from C partition? - android-studio

I moved the .android folder from C to another partition and created a new environment variable named ANDROID_SDK_HOME and the value E:Android. The problem now is that .android folder keeps getting recreated with 2 adbkey files inside old path in C.
It needs to get recreated in C otherwise the Emulator doesn't install apps.

Related

I am trying to define a function that could set a directory, and I don't know why this keep showing file exist error

The function I write is suppose to create a new folder if there isn't one in the specific directory and if the folder is already in that directory then return True.
It seems some how my code on checking whether the fold exist in that directory is not working.
Help me please.
enter image description here
Let's do a quick debug.
The current working directory is .../Desktop/Birth Of Evil/Project 2. Can we agree with that?
You're calling direct('Project 2/Files'), where a equals to Project 2/Files.
Inside direct, you get the current working directory, which is .../Desktop/Birth Of Evil/Project 2.
You check if the current working directory is equal to .../Desktop/Birth of Evil/%s.
Since a is equal to Project 2/Files, so you're checking if the current working directory is equal to .../Desktop/Birth of Evil/Project 2/Files.
Is the current working directory (.../Desktop/Birth Of Evil/Project 2) equal to .../Desktop/Birth of Evil/Project 2/Files? No, the latter is ending with a Files directory.
Enter the goddamn else. You're creating a new directory named .../Desktop/Birth of Evil/%s.
Since a is equal to Project 2/Files, so you're creating a new diretory in .../Desktop/Birth of Evil/Project 2/Files.
Whoa, it gives you the error! There is already an .../Desktop/Birth of Evil/Project 2/Files, so you can't create a new one in the same place.
You can just check if .../Desktop/Birth of Evil/%s exists. If it does exist, don't create a new directory in the same place, change the current working directory to there.

NodeJS deletes one folder but fails on another identical one (EPERM: operation not permitted, rmdir)

I have a timelapse program that I wrote myself, using NodeJS. It takes a screenshot once per second while ever the computer is unlocked, and for each day it creates a new subdirectory named the current date. Thus I have a heap of directories like this:
The screenshot program runs at logon as the main user of the computer (using Task Scheduler).
I also have another NodeJS program that compiles the screenshot images into videos (using ffmpeg), and after the video is created it removes all files from within the directory and then removes the directory.
My problem is that for some reason while the compiling Node script successfully deletes the images inside each date-named folder, it's unable to delete the empty directories, failing with:
Error: EPERM: operation not permitted, rmdir 'E:\timelapses\daily\2020-04-10\'
Initially I thought it was a permissions issue, so I ran the video-compiler as administrator. No change, it still failed trying to delete the empty directory. Then I tried ensuring every date-named folder and the parent directory had Full control:
Still fails to delete! Getting frustrated, I created a simplified test script, literally just:
let fs = require('fs');
fs.rmdirSync('test');
fs.rmdirSync('test2');
The test folder is one I created myself (right-click > New > Folder), and the test2 folder is a copy (right-click > Copy > Paste) of one of the empty folders that NodeJS can't delete. Upon running that script the test folder instantly disappears but the test2 folder remains, and the script errors.
I'm so confused! Both folders look 100% identical in Properties, both are owned by me (the local user), both are Read Only.
What could be different? One folder was created by a regular Explorer window, the other by a NodeJS program. They're both appear identical as far as I can see. Both are totally empty as far as I can see (hidden and system files visible in Explorer, I see no files). The one that won't delete was a copy-paste, so it can't be held open by some program (and LockHunter shows no results). Are there some special, hidden attributes that I can't see?
In case it wasn't obvious, I'm on Windows 10. Node is v10.15.3 but the folder that refuses to delete was created with v8.16.1 (due to module incompatibilities).
Help!

When the DLL file which include in Additional Dependencies under child floder,How can I find it

I Want Put those DLL files under a child folder.
the system is Win7 later.
like there is an opencv_world300d.dll , i need move it into my working directory (its ./),but i want put it under child folder( i.e. ./DLL/) .
Does anyone Know about this ?
The link specified describes DLL search order on windows.
You can copy the opencv_world300d.dll in a sub-folder ( /DLL) but then you have to modify PATH environment variable to include new directory.

I want to copy files from temporary folder to in my c drive by creating new folder

if FileCopy(ExpandConstant('{tmp}\SPECTRUMJOBS_Data.MDF'),
ExpandConstant('C:\Program Files\Microsoft SQL Server\MSSQL11.LOGISTICS\MSSQL\DATA\SPECTRUMJOBS_Data.MDF'),
False) then
I tried the above one but I am not able to copy because there is no folder named DATA in the location.
so please help me to copy the DATA folder and the file
To force creation of directories you can use (text is from InnoSetup help):
Prototype:
function ForceDirectories(Dir: string): Boolean;
Description:
Creates all the directories along the specified directory
path all at once. If the first directories in the path do exist, but
the latter ones don't, ForceDirectories creates just the ones that
don't exist. Returns True if successful, False otherwise.
InnoSetup documentation is at ishelp
You answered yourself. If there is no folder DATA in folder MSSQL, the folder must be created first.
And... if there is no folder MSSQL in folder MSSQL11.LOGISTICS, that folder must be created first.
And so on...
Now read the above sentences in reverse order, and you're done.

Qt Installer framework - Copying files to location other than install directory

I know that, whatever data is placed in package/component dir/data, will be copied to the install directory. What I mean is if I have a binary, readme, license.txt inside package/component dir/data/myapp, package/component dir/data/readme, package/component dir/data/license.txt and if I choose my target installation dir to be “/opt/myfirstapp”, then inisde /opt/myfirstapp, I will have 3 files copied, myapp, readme, license.txt.
Having said that, I also have a “/usr” directory with in package/component dir/data/, however this is not the standard “/usr” which will be inside root “/”, it is just a replica. Now inside my replica “/usr” I have some directory hierarchy and some files, like /usr/bin/myapp, /usr/lib/libmyapp.so, /usr/share/icons” and many more, infact a lot. Now I want the replica “/usr” content to be copied to “/usr” (the original usr inside root folder). I should also make sure that I just add new contents to “/usr” (root /usr), but delete any existing content.
Question is clear, some files inside my data directory will have to go to target install dir, but some selected ones (for ex: /usr) will have to be copied to other paths. How do I achieve this.
Currently we have the same problem in my company: we need 2 target directories, one for the exe and one for the libraries (well, it's a bit more complex but in few words...).
After having spoken with Qt support and got the answer that it's actually not possible ("It is possible only after extracting. After extraction, you can use copy or move operation, unfortunately there is currently no other way.") I decided to use the AdminTargetDir as the second target directory. This because there's no other way to pass dynamic variables to the IFW. So after installation I call a "finalizeInstall_patch.bat" file passing the TargetDir and AdminTargetDir and this will move the libraries directory from TargetDir to AdminTargetDir. Why a .bat patch file ? because it's actually not possible to move a directory using the methods provided by the IFW. Qt support just opened a suggestion-ticket for our problem: https://bugreports.qt-project.org/browse/QTIFW-595
I hope that this answer will help others having same similar problems.
NOTE: There is a way to move a directory (on Windows), calling addOperation("Execute", "cmd /C move source dest...") but this brings to other problems out of topic here.
This worked for us (Qt Installer, macOS):
var args = ["cp", "-R", "#TargetDir#/MyApp.app", "/Applications"];
component.addOperation("Execute", args);

Resources