I'm working on a shell extension that is supposed to display extended properties of files (mostly .jpgs) stored on a virtual drive (think of it as an external harddrive).
Is it possible to register the shell extension in a way that it only kicks in for files of a specific folder/drive (in my case the external harddrive) and leaves the handling of jpgs in other folder to the Windows default shell extension?
Regards,
Sebastian
This article lists ways that you can register your shell extension: http://msdn.microsoft.com/en-us/library/cc144096(VS.85).aspx.
You should be able to create a system folder on your external harddrive that contains a desktop.ini file that points to your extension.
Alternately, within the extension itself you could check the path and not do the extra logic if it's not located in your designated spot.
Place Your app infos in:
HKEY_CLASSES_ROOT\Directory\shell\
Related
I have been searching for this for a while but no success yet. Not sure if I'm using the right terms...
I'm trying to programmatically automatize the use of an API (from a software called Pix4D) to which I need to pass a directory path as one of the parameters. This directory is supposed to contain all files that will be processed by the aforementioned API.
The problem is that the API only accepts a single path, while my business process will always organise the input files into several input folders (I tried, but I cannot change this).
I'm trying to find a way to create an extra folder that would contain some sort of reference to all the files organised in those input folders. Thus, when one opens that "virtual folder" path, he would see all files together. This would potentially allow me to use the path for the new folder as the input for the API.
So, suppose I have these files I want the API to process:
C:\proc\20170101\f1.jpg
C:\proc\20170101\f2.jpg
C:\proc\20170201\f1.jpg
C:\proc\20170201\f2.jpg
C:\proc\20170301\f1.jpg
C:\proc\20170301\f2.jpg
I would need a single path to a directory that virtually contains all those 6 jpg files.
Some constraints:
We don't want to duplicate files
The virtual path needs to be created via command line
It should work on a Windows machine
Yes, there might be files with same names in the input folders. We can work around this, if necessary
Open source/free solutions would be better
Any help is highly appreciated. Same goes to any different approach to the problem.
Thanks
I think there is a way to extend the Windows Shell to make (for example) other types of archives in the same vein of the support for ZIP-files "compressed folders".
I admit that the Shell Interface is pretty clear when you're familiar with the shell terminology, but really obtuse otherwise. My current guess would be IShellFolder, but I think this would be creating an extra folder at the same place as andin addition to the file, instead of providing special support for the file itself.
Therefore, what to implement?
There is no shell interface specifically intended for implementing compressed folders. It is implemented as an ordinary Shell Namespace Extension that just happens to create/open a normal .zip file and represent its content to the Shell using PIDLs and standard shell interfaces like IShellFolder, IShellItem, IDataObject, IEnumIDList, etc. The SNE even represents a .zip file itself as a subfolder within its parent folder, instead of as a file, so the Shell can traverse into the .zip file using the SNE's IShellFolder implementation like any other folder. The Shell has no concept that it is accessing a .zip file, it is just another Shell item whose characteristics tell the Shell how to work with it. The SNE's implementation handles the details of accessing/updating the .zip file instead of the file system.
There is a whole section of MSDN that describes has to create Shell Namespace Extensions, including:
Windows Shell
Creating Shell Data Source Objects and Extending the Shell Namespace
Creating Shell Extension Handlers
Implementing the Basic Folder Object Interfaces
I'm writing an InnoSetup script to deploy software to a user's machine (default c:/programfiles) but I also want the user to be able to navigate to, say, a portable flash drive as well (like on a second page) and then have the installer load files to the HDD (programfiles) and then have it load files onto their selected flash drive - is this possible? How would I go about executing it?
thanks :)
I am not quite sure what you are trying to do but it sounds possible to me.
As you stated you could do this with a second page where you allow the user to select a drive or a directory where some files are.
You can then iterate over all files and install them into the selected program directory you chose in the setup before.
For more information it would be good if you could provide more information but so far this is the best answer i can give you for the provided information.
Maybe this helps you along when listing up all files in a directory:
Inno Setup: list all file names in an directory
And with this you can copy them:
Inno setup filecopy
And if you want a FolderBrowser use this:
Pascal Scripting: BrowseForFolder
I want to zip a folder structure from a batch file on the windows server. Lets say Structure is Like D:/DBA/ and inside DBA there are many folders with files and in DBA folder also there are files. Now i Want to Zip this DBA Folder and all folders and files inside it.
Kindly suggest how can i achieve this from a batchfile. Thanks in advance
Multiple forums suggest that the zip functionality built into Windows is provided by dlls for which there is no command line argument. For example:
The unzipping is a function of `zipfldr.dll`, so would use `regsvr32.exe` to invoke it, and as far as I know there are no arguements you can add to it for unzipping via batch file.
I would recommend a third party program, of which there are many (which you could provide along with a script): 7zip, winzip, pkzip, etc.
Also you might want to look into below as alternatives to batch files:
VBScript: Windows' built-in ZIP compression to be scripted
It's not possible without a third-party zip tool. Windows does not include a command-line zip tool.
It's not possible, as Windows Server doesn't have ZIP-compatible archiver.
As a "built in" option, you can check Windows Server Resource Kit Tools download, which contains compress.exe tool, but it's not compatible with .zip format.
Another option is to use 7zip standalone (7za) executable, which doesn't need to be installed and works "out of the box".
This may sound like I'm just looking for a .exe file, but I'm not all that familiar with windows. I have been using pyinstaller to turn my apps into binaries. My app relies on a lot data directories and third party binaries that I package within the same directory as the executable binary. For Mac, this makes things easy because the user only has to click on MyApp.app inside the applications directory which is like a link to MyApp.app/Contents/MacOs/MyApp. This way MyApp never has to be touched and is all bundled together with the data directories (also loaded inside of MyApp.app/Contents/MacOs/).
However, I can't really find a windows equivalent. While Pyinstaller can create a directory with my data directories and executable inside of it, if the user ever moves the .exe file inside the directory, the app will never work (because it loses its relative location to the data directories). Is there such a thing that can package this directory like on MacOS so the user just has to click on a single .exe file that links to the .exe inside the directory packaged within it? That way we can just pass around one directory. Like a Mac.app?
Win32 apps store data within the executable file as resources, which allows the single file solution, but they can't be accessed using normal file APIs, there are a separate set of functions for resource handling. (This implies that resources aren't so useful for things that absolutely have to be files, like images of helper executables.)
Win32 also has alternate data streams, which are more similar to what you're used to with .app packages, separating a local identifier from the actual filename by $DATA:. But those only work on NTFS, get lost by many file management applications, never have been very popular, and are now effectively deprecated by Microsoft (by preventing access from Windows Store apps).