copyfile is copying into VirtualStore folder? - winapi

I have created one application on Vista, that is running with admin privileges.
I am trying to copy one file to ProgramData\Application\ folder.
But instead to copying there its copying at location c:\Users\XXX\AppData\Local\VirtualStore\ProgramData\Application\
I dont want this file to get copied into Virtul store.
Any suggestion , how can I overcome this issue?
I am using CopyFile API.

Add a Vista manifest to your application to disable the FS virtualization

Related

MacOS .app files display and behave like folder in windows explorer

I have a spring boot server hosting a product's file distribution and the product has .exe and .app versions. The .exe file is stored and transmitted without issue but the .app file (created from MacOS and transferred into windows via TeamViewer) is displayed as a folder. The server does not recognize it as a file as well and throws
java.io.FileNotFoundException: source\MyApp.app (Access is denied)
When I create a sample text file and save it as test.app it is treated as a file and not a folder. There is no option to change the folder to a file or method to change it's default opening with explorer. I think it does not care about the .app extension and it treats the .app as file name. I tried to zip it and send to windows but it still doesn't work. See the screenshot for what I mean.
My question is is there any way to change the way windows treats the .app file as a folder? I want it to treat it like a unopenable or raw file.
I solved it by removing the extension and treating it as a normal folder (because .app will not allow Java to read from it and I don't know why). Then I read the contents of the file and made it into a zip archive with the extension 'app' and it works correctly.
I am accepting this as a temporary solution but need to find the cause of this problem.

Access Denied message when trying to open hidden folder in windows

Earlier i was using one batch file to lock my file/folder in windows. That time i locked my one folder from D Drive. It was working fine for me. But after some windows update i am not able to unlock my folder using this batch file.
I know this batch file is using cacls command to change the attribute of folder. It changes it's attribute as hidden and system folder. I tried cacls command as well from cmd but still it gives me Access Denied error.
Please suggest me any approach to get access to this folder. It will be appreciated.
Thanks!

Where is the location on the extracted .msi file?

I have a setup exe, and I want its .msi file for administrative installation (see https://superuser.com/questions/307678/how-to-extract-files-from-msi-package)
But, although I see at the beginning the extraction of .msi, I can't find it.
Where is the location of this file?
Usually MSI file(s) might be extracted in different temp locations depends from who was launched (User\System\etc) and how configured setup.exe. Sometimes you can extract it with help of different command-line switches for setup.exe.
The simple way to check - launch it under user account, go to %temp% folder, most likely there should be created folder with {GUID_view_name}. Inside this folder you will find MSI file.
User's %temp% folder has different location in different Windows versions:
Windows XP\2000\2003:
"C:\Documents and settings\{user name}\Local settings\Temp" or "%userprofile%\local settings\temp"
Windows Vista\7\8\2008\2012
"C:\Users\{user name}\AppData\Local\Temp" or "%userprofile%\appdata\local\temp"
P.S. Also you can check this SO question-answer.
Snapshot a clean VM and use a program such as Install Watcher or InCntrl to record the current state of the file system. Run the setup.exe until you are on the first dialog of the MSI and take another recording. Diff and look for where the MSI and related support files appear.
I found a much better solution, Igor, gave me the idea.
I used ProcessMonitor and filtered with Process is "msiexec.exe" and Path ends with ".msi".
I found the msi in:
C:\ProgramData\Downloaded Installations\{41A70E83-DA5D-4CA6-9779-73C9330E3D13}\IQProtector64.msi

How to prevent Dart from using my home directory?

I'd like to use Dart on a Windows machine where my home directory is configured to be on a network share. I have no control over this configuration.
Initially, I couldn't get the Dart Editor to run at all as the default location for its configuration folder is defined in DartEditor.ini as #user.home/DartEditor. This prevented me from creating new projects at all. I have edited this file so that my Dart Editor configuration folder is now located at c:\DartEditor which seems to solve that problem.
However, when creating a new project, Pub tries to install libraries to my home directory and Dartium tries to save its configuration there as well. This causes Pub to just fail (so I can't build any projects) and Dartium to warn me that storing it's configuration on a network share will cause it to slow down.
How can I prevent Dart Editor (and any associated tools like Pub and Dartium) from using my home directory and instead use a directory on my local drive?
What about to download Dart and unzip it to:
C:\DartHome
I also recommend to change the DartEditor.ini file on the second line to:
C:\DartHome\DartEditor

error when i want to save java file in jdk/bin

when i save java file error is you dont have permission to save in this location contact the administrator to obtain permission on window7
Don't store application data in the "Program Files" directory.
It is very bad design and regular users don't have write access to that directory (for a very good reason).
So even if you changed your settings locally to open up the door for viruses your application won't run on other computers.
Besides: storing a Java file in the JDK directory serves no purpose at all.
Btw: your uppercase letters are broken, as well as the dot or the comma...
That's normal - jdk/bin is the installation directory of the JDK, regular users cannot (and should not) write files there. You'll have the same problem on Linux/Unix and on Mac OS X, where installation directories are off-limits to regular users.
Write your files to the users home directory (System property "user.home", works across platforms), or let the user choose where you save stuff.
Bin directory do not allow directly to save program in it.
it is so simple, just save your .java file on desktop and then copy paste it in Bin. done ;)
If the file can't save directly to c:\program files\java\jdk1.8.0\bin\
Solution:-
Click start Menu type Notepad command in run run as administrator
Right click the Notepad run as Administrator, then type the program file can save directly to c:\program files\java\jdk1.8.0\bin\
Just try it......

Resources