Creating a file type with new icon - ico

I have a text based file i have given an extension named .val i have also changed its icon by selecting Computer>Open tools>Open folder options>
however though this changes the icon for the extension it only changes it on my computer, I would like to know how I can do this for all machines. even if that means building somthing that needs to be installed, which is fine with me

I wrote a little program awhile ago. The windows registry thing is a mess. Save yourself a lot of time and use this installer package - it has a wizard that will create an install script for you. Navigate to your program, icon, etc. Pretty easy.
http://hmne.sourceforge.net/
As I recall, in windows icons are set based on what program is opening it, so indirectly the file type. So first you have to create reg entries for your application on your computer. Then you have to associate that file type with your extension. And then the extension gets the icon from your app settings. This of course is different in WinXP vs. Win7. Thus why I think you should avoid a lot of headache and use an installer.
[HKEY_CLASSES_ROOT\Your App\DefaultIcon]

Related

Unity Build - Standalone file

I have made a Unity build and would like to share it with colleagues.
But i dont want to share it as the standard "folder structure" -build.
So, I have made a single .exe file with an icon, using Winrar selfextracting file.
It works great....BUT Windows and antivirus apps screams bloody murder when they try and open it, thinking it is a potential virus of course.
That makes the file unusable for web sharing (Sharing on a USB drive there are no problems).
How can I make a single file build, for web download, that does not make Windows and Antivirus apps go crazy?
Basically...
You need to pack(age) the build of the app.
(Note the boxing app in the linked tutorial is just an example. There are many ways to pack the game into an executable, and you don't need that specific one.)
Depending on platform, it's also either required or recommended that you sign (1)(2) the app and/or executable.
That's not that trivial since antivirus hate selfextracting exe files ;)
Either go with the usual folder structure and ship it as a .zip.
Or you could go the correct but more complex way and create a proper Installer that correctly asks for admin permissions and then is allowed to extract content into the usual program paths.
Or you can try and use this but it might underly the same issue as the selfextracting exe.

Unity "player preferences" file format and contents

Upon quitting my application, I use PlayerPrefs.Save() to save the player preferences.
I understand this function writes all the modified preferences to disk.
So, I clicked on Start, typed regedit and opened it, went into HKEY_CURRENT_USER and then Software and then I selected Unity.
So, now I can see the file (is this actually a file?) but I cannot figure out how to open it or see the contents...
Neither double-clicking on it works nor right-clicking on it brings up any menu with options.
How do I access the contents, or perhaps clear/flush it after a while?
You find the PlayerPrefs under:
HKEY_CURRENT_USER/SOFTWARE/[NAME OF THE COMPANY YOU SPECIFIED IN PLAYESETTINGS]/[PRODUCTNAME YOU SPECIFIED IN PLAYERSETTINGS]
If you had checked unity's documentation it is very well explained for each platform here
The exact storage of PlayerPrefs depends on the platform. For Windows it is stored in the registry, as you have seen.
This is not an isolated file for your Unity game. As such, there is nothing really to open. You could edit the registry if you wanted to, but that's not really the appropriate way. Just keep using it via the provided PlayerPrefs API.
If you want to clear your playerprefs, you can call PlayerPrefs.DeleteAll(). This will clear all playerprefs data and would allow you to "simulate" a new user starting from scratch for example.
For Win32 and Win64 builds it is in a Registry file editable from the registry.
In OS X builds it is in a plist file in ~/Library/Preferences These are in plist compliant format and can be edited in the standard OS X plist editor, or a text editor if you follow proper syntax.
In Windows Store builds it is in %userprofile%\AppData\Local\Packages[ProductPackageId]>\LocalState\playerprefs.dat (I don't know the format of this.)
Windows Phone builds store it in the application's local folder, again no documentation on format.
Android and Linux are in xml format, editable with a standard text editor.
The Android config files are package's shared prefs directory and the Linux config files are under ~/.config/.unity3d

How does my computer know to assign a certain image to .doc files?

Is the icon file for .doc and .docx built-in to Windows, Mac, and Linux because it's so common? Or would the OS only know to associate that extension with the icon image IF Microsoft word/office was installed, which gave the image file to the OS and instructed it to make the association?
I didn't know how to search for this. I also didn't know whether to ask on Superuser, SO, or Programmers.SE.
For windows, when an application is installed, it registers with the OS what file extension it has for the files. So when you install Office or MS Word, it will tell the OS that it's files can be .doc or .docx and what icon to use for those. Then when any files that have that extension are shown, it will open up in that program. It stores the info in the registry.
If you try to open a .docx file that is not registered, meaning Office not installed, it will ask you to choose a program to launch it with, because it doesn't recognize the file.
You can also manually associate files as well to a specific program if it is not registered.
Most of the time, the associations are done when the said application is installed.
Some operating systems such as Mac and Linux can associate files with their mime type e.g. text/plain. That way it would know to use a text editor to open the file.
You can read a little more detail here about file associations.
http://en.wikipedia.org/wiki/File_association
In windows vista/7, go to your control panel, and search for 'assoc'. Under folder options it has a option labeled 'change the file type associated with a file extension'. This will give you a list of all of the files extension (what comes after the '.') and what program/icon they use.
Most programs create these extensions when they are installed. Some very common formats, like .html, will have association made on any modern system.
Files also get associated when you tell the system which program to use to open a type of file. The icon that type of file uses is usually just the icon associated with the program in that case.
Hope that answers your question.

Editing hidden files in Netbeans

I currently have hidden files displaying in netbeans 7.3.1. I can even open the files and make changes but when I try to save I get an (Access is Denied) message.
Just to check I tried opening the same file in notepad, attempted the same thing and the save was successful.
I assume it has to do with a permission issue between netbeans and the file on my windows system.
I'm running Windows 7 x64 SP1
I cannot just run netbeans as administrator.
I can't seem to find anything online about this, every link that comes up has to do with simply displaying hidden files in netbeans which I have done already.
The files I downloaded began with a . (.header.html, etc) which I know usually means hidden. In order to proceed my work I manually removed the dot assuming it would allow me to edit the files. It did not, so I went ahead and checked the file properties and apparently it was still considered hidden. I then unchecked hidden and saved and was able to edit the files in netbeans perfectly fine. I wanted to see if I can keep the . and have the hidden field unchecked and it works perfectly fine.
I know the . signifying hidden is more or less linux specific, but in every version of windows I've used it seemed like the . had the same effect. What happened was I copied these files from an older computer (windows xp) so the file must have retained the flag but in windows 7 the . has no influence. I just checked to confirm by creating a file .test.html and the hidden flag was not triggered.
Hope this helps someone in the future.
You can try to remove the hidden file privilege from the files that you want to edit. In the menu bar click organize from there select folder and layout options. Now You will see a lot of options click the ones that say to display hidden files.

Where do I specify the text of a Pocket PC app's shortcut?

I'm unfamiliar with Pocket PC development, but I have to make a few minor changes to an VS2005, Pocket PC 2003 Device application. One of the changes (which I thought would be trivial) is changing the text of app's shortcut, but I can't figure out where this text is set. The solution includes a setup project, so I'm looking for it in there, but I can't find it. I know it's got to be in there somewhere because building the setup project generates an AppSetup.inf file that contains the shortcut information.
This can't be that difficult. Surly I'm suffering from what my wife refers to as "male vision" when I can't find the bottle of mustard in the refrigerator that's right in front of my face. Where do I specify this text?
It depends on exactly how the shortcut is generated. There are generally 3 mechanisms that are used.
Via the CEShortcuts section of the INF. For this, it's the text before the first comma
Via copying an LNK file via the CopyFiles section of the INF. With this mechanism, you create a physical LNK file on the desktop that gets rolled into the CAB and it's copied like any other file. The name on the device is again the first string before the comma.
Via a programmatic call (usually to SHCreateShortcut) in a custom CE Setup DLL.
You'll have to figure out which is being used in your deployment scenario to know exactly what needs to be changed.
Thinking more about this, are you trying to simply find where in the Studio UI of the installer project to change the shortcut? If so, this MSDN article may help. What is very non-intuitive is that there are little icons at the top of the Solution Explorer that change the view of the installer, allowing you to see things like files, registry entries, etc. It may be that you simply aren't looking at the right view and you need to select a different icon. There are no menu items that do what these icons do, and they are hard to notice the first time you start using an installer project.
Well, as I suspected, it was right in front of my face. We'll call this project PDAProject. In the solution explorer, under the PDAProjectSetup project is an item labeled Primary output from PDAProject (Active). If I double-click on this item two panes appear in the code editor window. The one on the far left shows a folder tree labeled File System on Target Machine. Under this are three folders labeled Application Folder, Program Files Folder, and Programs Folder. When I click on the Programs Folder, the application shortcut appears in the pane on the right and I can modify its text.
I don't know why I was never compelled to double click on that Primary output from PDAProject (Active) project item even though that's how you open any class or form for editing. I kept right-clicking and opening the Properties. Maybe it's time to give up programming and take up basket weaving.