Using custom file formats as Windows Explorer file systems - winapi

Are there any tutorials on how to load custom archive file formats as file systems in Windows Explorer, similar to CAB and ZIP files?
I tried searching for namespace extensions tutorials, but it appears to be a different thing.

See this project - Mini Shell Extension Framework.
Part 1
Part 2
Part 3
Most important for you is first part, from project description:
In order to show how to use the classes and to provide a sample of how
to create a shell extension, the code includes a small sample that can
open .vvv files. VVV files are just renamed .ini files that act as a
container. Most shell extensions are container views (for example, the
Windows .zip and .cab shell extensions).

Related

How Can I Package a Unity3D 5 Windows Application into a single exe file?

I am new to Unity3d development. I have created two versions of a 3D puzzle app, one for Mac and the other for Windows. Mac applications are created with the package contents contained within it. The Windows application is created with the exe file and a separate data folder with the same name as the exe file + suffix _Data. I want to create a single exe file to distribute on Amazon and other downloadable platforms. The problem I'm having is finding something where the data folder and the exe file have to be located at the same level.
I'm used to Apple devices but recently purchased a Windows laptop for testing.
I could not find anything in the Unity3D documentation on how to do this. The documentation talks about how to distribute the application to the Windows Store, something I don't plan to do. The only thing I could find on their forum was one question that was asked in 2011.
One of the suggested solutions, Enigma Virtual Box, I could not get to work because Unity3D requires that the exe file and the data folder be at the same level. I have also tried the trial for Smart Packer Pro but I need a dll file as a starting point which I could not find in my Unity3D project folder.
All of the information I'm finding related to Windows packaging into a single exe file are at least five years old. None of them relate to packaging Unity3D applications. I have also searched microsoft.com and windows.com but could not find anything there.
UPDATE 5/12/2016 14:15
I installed Inno Setup and attempted to create a script for my application. It copied the exe file but created an empty data folder instead of copying the data folder I need to run the exe file. I checked to make sure that the folder name was correct in the script.
; -- myapplication.iss --
; Demonstrates copying 3 files and creating an icon.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
[Setup]
AppName=myapplication
AppVersion=1.0
DefaultDirName={pf}\myapplication
DefaultGroupName=myapplication
UninstallDisplayIcon={app}\myapplication.exe
Compression=lzma2
SolidCompression=yes
OutputDir=userdocs:Inno Setup Examples Output
[Files]
Source: "myapplication.exe"; DestDir: "{app}"
[Dirs]
Name: "{app}\myapplication_Data";
Packing a Unity3D application is not not possible without 3rd party software.
a bit more recent url (2014) suggests using smart packer, this however is a tool I personally never used before.
I tend to use inno setup as it seems a bit more professional, it eases up moving files, creating links (short-cuts) and uninstalling quite a bit as well. Simply said, this allows you to extract the exe and _data folder to the same folder, and create a shortcut to the exe.
Follow up on edit
I installed Inno Setup and attempted to create a script for my application. It copied the exe file but created an empty data folder instead of copying the data folder I need to run the exe file. I checked to make sure that the folder name was correct in the script.
After selecting the main exe file during the application files part of the setup wizard, you can add a folder. Here you can select yourgame_data folder to be included in the installer. This however does require an additional step. After adding the folder, you need to set the destination subfolder to yourgame_data for it to be able to properly create the subdirectories. You can refer to this picture guide for more information. I included the relevant step(s) below.

Zip a folder structure from a batch file on windows server

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".

develop a firefox extension in place (not via encoding to xpi first)?

Developing an extension for Mozilla Firefox I wonder if there is an "easier way" to what I do right now. Currently I do:
Create a folder - in which to develop - for example myextension
Inside this folder: Create and Edit the Files (like install.rdf, chrome.manifest, xul files. Basically all the other structure of a Firefox extension (no problem here))
Zip-compress the content of the myextension to a ZIP-file (i.e. named myextension.zip)
Rename myextension.zip to myextension.xpi
Install the xpi-file-firefox-extension then in firefox
Restart Firefox
Test the extention
After each edit to the codebase of the extension I need to undergo the process of 3. zip-compress, 4. Rename, 5. install XPI file to firefox, 6 restart browser.
Of course I could automate some of this but still I wonder if there is another way to develop the firefox extension directly in the running firefox profile folder .
The extensions I know are stored in the Firefox profile folder as:
firefox/profile/extensions/nameofextension.xpi
I cannot remember well, but I think that there was a way to have the extension being stored unzipped as a folder there too? This way I would still need to restart after edits but not do all the laboursome zipping-renaming-installing.
Any ideas?
It is possible to setup a directory to "in-place-edit" a firefox extension. By this the effort between editing and testing of the Firefox-extension can be reduced.
I have found the good explanation on the blog https://blog.mozilla.org/addons/2009/01/28/how-to-develop-a-firefox-extension/
Here I want to give the principal steps necessary to achieve the "in-place-edit"
Step 1: You have to find your profile directory of Firefox.
For example in Linux this would often be often something like this:
~/.mozilla/firefox/#%#%.default/
Step 2: Go to this profile directory
Step 3: If you already have any extensions installed (like for example adblock+ or noscript), then inside this profile directory you will find a folder named extensions. If you do not have yet any additional extension installed, it might be easy to simply install any, only to have the **extensions" folder be setup for you.
Step 4: In this extensions folder you can create a new directory (let us name it "myextensions_1"), which shall contain the stuff of your plugin. This stuff would be the ordinary things like the install.rdf, chrome.manifest files and the content,skin,locale subdirectories. In effect all the stuff you would normaly zip up to become the XPI file.
Step 5. Create a file that is equal to the content of the <em:id> tag that you used in your ìnstall.rdf file. So if you used <em:id>myextensionname#author.org</em:id> you need to create a file named myextensionname#author.org. Inside this file you will write the location of the "in-place-edit-extension-folder" we created before. In our example this we would have
the file myextensionname#author.org
which contains only the text ~/.mozilla/firefox/#%#%.default/extensions/myextensions_1
Of course the text depends on the location of the folder you use for your plugin.
If you did all things correctly - and maybe double-checked with the instructions of the link above - you can restart or "newly start" firefox. The browser will ask you if you want to allow the usage of the plugin myextensionname#author.org, which you can conceed.
Now you can edit in the folder ~/.mozilla/firefox/#%#%.default/extensions/myextensions_1 and need not to worry about zipping-up -> renaming -> installing.
You simple restart Firefox and the edits to your extensions code will become available.
This will allow you swifter and faster developing "in-place".
Note: this is a shameless self-plug - I am talking about an extension I created myself.
Developing an extension in place is possible but has so many issues (mostly caching of all kinds) that it really isn't a good option. Still, you can simplify your development cycle a lot. For that you need to install the Extension Auto-Installer add-on in your Firefox. Then you can put a batch file (assuming that you are developing on Windows) into your extension directory along the lines of:
zip -r test.xpi * -xi *.bat *.xpi
wget --post-file=test.xpi http://localhost:8888/
del test.xpi
The required command line tools are all preinstalled on Unix-based systems, for Windows you can easily download them: zip, wget.
Then you will only need to run that batch file to update your extension in Firefox. If your extension isn't restartless then Firefox will restart automatically. So this replaces your steps 3 to 6.

VB6 Registration - DEP file

I have an app that I am moving to another server. It is complaining that it is missing TABCTL32.OCX. I have located this file on another server and I want to copy and paste it across.
I have discovered that there is also a file called TABCTL32.DEP on the server I am moving from. Do I have to copy both files across or is the dependency file optional?
I have tried it with an without the DEP. The app works in both cases. It is a production server so I want to be sure.
Those .DEP (depdendency) files are instructions about a library meant to be used by packaging tools. These files have no run-time significance, containing only development metadata. They are text files.
They contain the preferred ("designed") location to install the library, sub-dependencies of the library including optional localization "satellite" resource DLLs, version information, etc.
See articles such as INFO: How Setup Wizard and PDW Use Dependency Files.
This is information a packager should use along with other "rules databases" such as VB6DEP.ini. Programmers are also supposed to create them if they expect other developers to use their libraries.
If you are using an "impaired" 3rd party packaging technology that is ignorant of .DEP files it is up to you to read them and incorporate the information they contain in your build process. You are also responsible as a developer to keep your dev machine's .DEP files and VB6DEP.ini file up to date, since they often are not updated by Microsoft anymore.
You can't just copy files willy-nilly from one machine to another. Go find this program's installer and run it on the new machine.
A .dep file is a file used by the Visual Basic Setup Wizard to determine what dependencies your ocx file have. You can open the file with Windows Notepad to view the contents.
Unless you are using the Visual Basic Package and Deploy Wizard, you can ignore this file.
For more info, see INFO: How Setup Wizard and PDW Use Dependency Files

Restrict Windows shell extension to folder/drive

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\

Resources