devnotebook

Juan Ignacio Gelos

  Home  |   Contact  |   Syndication    |   Login
  23 Posts | 2 Stories | 81 Comments | 4 Trackbacks

News

Save the Internet: Click here
GeoURL

MSN Alerts
Get MSN alerts when this blog is updated.



Random books from my library:

Article Categories

Archives

Post Categories

.NET General

Blogs

Microsoft

Wednesday, November 30, 2005 #

ClickOnce supports using HTTP compression for the file downloads, a Web server technology that uses the GZIP algorithm to compress a data stream before sending it to the client. The client—in this case, ClickOnce—decompresses the stream before reading the files. This results in shorter download times for your ClickOnce deployments.

If you are using Internet Information Services (IIS), you can enable HTTP compression easily.

Enable Compression in IIS

  • From the IIS snap-in, right-click on the Web Sites node and click on Properties
  • Select the Service tab - Enable Compress application files
  • Enable Compress static files
  • Change Temporary Directory to a folder that you created (the IUSR_{machinename} will need write permission to the folder), or leave it at it's default
  • Set the max size of the temp folder to something that the hard drive can handle. i.e. 1000.
  • Save and close the Web Site Properties dialog

However, this only activates it for certain file types—namely, HTML and text files. In order to activate compression for assemblies (.dll), XML (.xml), deployment manifests (.deploy) and application manifests (.manifest), you must add these file types to IIS's list of types to compress. Until you do this, none of the files in your deployment except text and HTML files will be compressed.

To add the document types for ClickOnce deployment files (.application, .manifest, .deploy, .dll, .exe, etc.), follow these steps:

NOTE: The commands in step 3 replace the previously defined file extensions. It does not append them to the existing file extensions.

 1. Open a command prompt session. To do this, click Start, click Run, type CMD, and the click OK.
2. Change the directory to your \InetPub\AdminScripts folder. To do this, type CD \Inetpub\AdminScripts, and then press ENTER.
3. Type the following commands:

CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcFileExtensions "htm" "html" "txt" "application" "manifest" "deploy" "exe" "dll"

CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcFileExtensions "htm" "html" "txt" "application" "manifest" "deploy" "exe" "dll"

IISRESET.EXE  (this will reset Web services)

In case you also want to enable compression for ASP.NET Web pages and Web services, drop in these (extra) two lines before the IISRESET:

CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx"

CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx"

 

Testing

To test the web server is compressing you can do two things:

1. Check the "...WINDOWS\IIS Temporary Compressed Files" folder on the server and see if new files are added as you go through the ClickOnce installation process.

2. Use netcat (yes, yes, from the old days of hackerish "security tools", nothing beats netcat yet) to manually send an HTTP request to the server and see if the HTTP response contains the header "Content-Encoding: gzip"

A sample HTTP request header you would send is:

GET /clientes/ventas/Ventas_1_0_0_8/Ventas.exe.deploy HTTP/1.1
Accept: */*
Accept-Language: es-ar
Accept-Encoding: gzip, deflate
Host: youhost.yourdomain.com
Connection: Keep-Alive

where the "replaceable parameters" are "youhost.yourdomain.com" for your webserver HOST, and "/clientes/ventas/Ventas_1_0_0_8/Ventas.exe.deploy" for the URL path to your application's exe .deploy file

 

Sources

IIS Compression in IIS6.0
http://www.wwwcoder.com/main/parentid/170/site/3669/68/default.aspx

HOW TO: Enable ASPX Compression in IIS
http://support.microsoft.com/default.aspx?scid=kb;en-us;322603

Troubleshooting ClickOnce Deployments
http://msdn2.microsoft.com/library/fb94w1t5(en-us,vs.80).aspx

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Yesterday I was reading Jeff Atwood's blog (on Keyboarding) and I thought I´d try one more time to find a nice tool to remap the keyboard.

See, when you use non-english keyboards you tend to start wondering about why would you need to press Ctll-Alt and 2 just to type the @ char, while you have keys mapped to symbols you never use: the spanish keyboard, for example, has keys mapped to º, ª, ç, Ç, and so-called "dead-keys" so you can press them and then type a, e, i, o, u and get the accented version of those chars, THREE of them we never use in spanish: `, ^ and ~; ç and Ç are only used in portuguese!

I always wanted the ability to remap these keys into characters that would be a lot more useful while coding, so I had tried several approachs before, including Chris Sells Scancode Mapper, but those only allow you to remap entire keys, they don't really allow to modify the characters that appear when you 'modify' them with Shift or Ctrl-Alt (AltGr).

Enter the Microsoft Keyboard Layout Creator (MSKLC). KLC allows you to create a new Windows keyboard layout from scratch or customize a preexisting one, and build an MSI installer for it. You can then simply install it and configure Windows to use your custom layout.

The main window presents you with the representation of a standard keyboard (if your keyboard has an L shaped enter key you can change the physical layout so it represents your keyboard in the View... Options menu).

You can then double click any key to enter the new character that should be sent to Windows when it's pressed. If you changed the state by marking "Shift" on the main window, when you do this you'll be changing the character that will be sent when Shift and that key are pressed.

You can either simply enter the new character that should be sent, or enter it's Unicode number (UTF-16 code point).

If you want to go deeper, you can expand the key properties window (by pressing the All... button), so you get access to change the normal, shift, ctrl+alt (AltGr), shift+ctrl+alt, SGCAPS, etc, and to define your own Dead-keys.

Defining a dead key is straight-forward: just enter the normal characters that should be pressed after the dead-key, and the resulting characters that should be sent.

You can preload any installed Windows keyboard layout so you don't don't forget about any essential character.

Once you've defined your own keyboard layout, you can build the installer for it (Project... Build DLL and Setup Package), and proceed to install it.

 

Once you have it installed, all you need to do is open Regional and Language Options in the Control Panel, and configure Windows to use your new layout.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati