|
Monday, October 06, 2008
This is my third post in my WiX and DTF series for WiX 3.0. Here are some others I’ve written:
Normally bootstrappers are used for adding prerequisites to your installation; like the .Net Framework, Windows Installer etc. You can also use it for other purposes though. Basically it's an exe file with the msi (and any other installers) embedded. For the WiX series I'm currently doing we need this because: - Use as workaround for the WiX bug in IIS extension where the installer fails because of missing privileges on Vista SP1.
- We want to do IIS custom actions in InstallUISequence which require elevated privileges which I will cover in a later post (hopefully very soon!).
I briefly mentioned InstallUISequence above. Windows Installer have several sequences, for details you can check them out here, but I'm just going to shortly explain two of them now. The InstallUISequence is the wizard part in the installer, InstallExecuteSequence is where things are happening and files are getting installed (when you click "Install" in the wizard). Here's a bit of background. In Vista msi files does not run elevated (as admin) when you start them directly (double click on the msi). To do that you need to open an elevated command prompt and run the msi with msiexec /i yourInstaller.msi. That's not a good solution. Normally there should be no need for admin privileges in UISequence (it's a reason it's not permitted per default), but there are exceptions, like the above. At least from my perspective. If you have a better way of solving this, I'm very interested. So, with a bootstrapper or exe file you can do a bit more. For instance you can use mt.exe to add a manifest to he exe defining which privileges it requires to run. In this article I will describe how you can accomplish this using WiX and .Net. Here's how to go about it: - Copy Setup.exe found in the WiX bin folder to your project location (so we don't modify the original)
- Create a manifest file (e.g. Vista.manifest) in your favorite text editor by adding this xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Setup" type="win32" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
- Add the manifest to Setup.exe by using mt.exe found in the .Net SDK:
mt.exe -manifest [pathToYourProject\]Vista.manifest -outputresource:[pathToYourProject\]Setup.exe;#1
- Use setupbld.exe found in the WiX bin folder to embed the msi installer into a exe like this:
setupbld.exe" -out Setup.exe -msu MyMsi.msi -setup Setup.exe
or even better, add it as a post-build event (Right click your project -> Properties -> Build Event -> Post-build Event Command Line):
"C:\Program Files\Windows Installer XML v3\bin\setupbld.exe" -out $(TargetDir)Setup.exe -msu "$(TargetPath)" -setup "$(ProjectDir)setup.exe"
The interesting thing to note about the manifest file is this:
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
When setting the level to requireAdministrator Vista will show a UAC prompt when executing this file. The default level is asInvoker, which will run the exe with the current users privileges, but then the exe would have the same behavior as the msi.
Also note the assemblyIdentity node where you can set the actual version number of your installer and the name (if you use something else than Setup.exe).
Sunday, June 15, 2008
Recently I've done some work on automating the creation of our deployment packages. In this process I've used some tools on my Vista client to make sure things work before running live on the server. Like yesterday I used mt.exe to embed a manifest file into our exe files, which (after several runs) resulted in: mt.exe is not a valid win32 application What!? I looked up the file in Windows Explorer and saw that the file's size was 0KB! What is it that I do so wrong that I'm able to totally clear out everything in an exe file just by running it? This has happened to me several times. Once with mt.exe, once with mage.exe and 2-3 times with Excel.exe (2007)! Excel was ok after log of - log on, but the other files I had to manually replace to get them to work. After searching the net I found that many has this issue with Excel 2007, Access 2007, Snippting Tool and Windows Media Player after installing Vista SP1. I guess I can add mt.exe and mage.exe to the list... Here's the post mentioned. The interesting part is this: Microsoft is aware of this issue and is working on a fix. As several people have observed, this is konwn to affect Excel 2007, Access 2007, Snipping Tool, and Windows Media Player on Vista SP1. The fix is to either exit as many apps as possible that you are running (e.g. Outlook), and then load the app (and then you can reload the apps you had running), or a logoff/logon will clear it up for a while (days/weeks). The error messages are confusing, but the problem is neither an invalid application file nor insufficient system resources. It only affects certain applications, and typically only after the user has been logged in for an extended period of time. and then a response on 14th of May from a MS representative: We're working on it, it's going through full testing right now and should be available in a few weeks if there are no issues found. In the meantime: You don't need to reboot, just log off and log back on. It's a per-user issue. That will clear it up if it's the same issue. I realize it can be a pain and I'm not trying to minimze the issue at all, but the workaround is simpler/quicker than a full reboot. It hits different people in different time frames. It depends on how many apps you are running and how often you have loaded/unloaded them. I appologize that it takes this long, but we'd rather not give you an update that had other problems/regressions, so we want to make sure it's fully tested, and that can take a few weeks in an environment as complex as this, as I'm sure you know. This is all good, but now in mid June there's still no fix to be found. The mentioned workaround works for me with Excel, but not the other apps. Please let me know if you see a fix for this, and if you work for Microsoft and has any info about the issue please let me know.
Tuesday, May 13, 2008
Update: This article is not limited to deploying applications to Vista, but also when changing files that are only writeable by administrators (e.g. files in the Program Files directory). If you have not made specific changes to your installation to support UAC in Vista, this is for you. I hope this will help others to not spend many days of confusion, desperation and sleepless nights like I have. Lately I've been getting reports from some of my coworkers running Windows Vista that the app.config file in our application was not updated after installation. I've also experienced this myself. We've solved them without knowing exactly how (which I hate). Typically "I uninstalled the application and installed to a different location, and it worked!" Well, this is a workaround that are not particulary popular to any of our customers, so I dived into the problem to find the exact reason. To save you some reading I'll just say that the reason and solution is to provide your application with a manifest file to handle UAC in Vista as described in this article: Create and Embed an Application Manifest (UAC) I haven't actually tried this out yet, but I trust the article to be correct  Virtualization But that's not the interesting part. The interesting part is what happens (or what can happen) if you don't have an application manifest for this purpose? If your superstitious you might think that something weird is going on with your computer. If you're like me you KNOW that something weird is going on with your computer, and you need to find it and fix it. The weird thing is Vista virtualization. "File virtualization addresses the situation where an application relies on the ability to store a file, such as a configuration file, in a system location typically writeable only by administrators" "Virtualization is implemented to improve application compatibility problems for applications running as a standard user on Windows Vista." As I write this I have exactly this problem on my computer. I've installed our application (Contiki ECM) to this location: C:\Program Files\CMA Contiki AS\Contiki ECM\. This is where I've always install our app. So today I installed and checked that the app.config was updated with all my changes done during installation. And it hadn't. Actually it was updated, but not with my changes. It looked like an old file that I had some time ago. How could this happen? Textpad .vs. Notepad To make this even more confusing, I discovered this reading the file in TextPad, but when opening the file in Notepad it was fine. All my changes was there! So I thought that this was a TextPad problem. I started our application, but it turns out that when .Net tries to read the config file, it reads the same old stuff as TextPad did, resulting in old config to be loaded into our app. Why does Notepad get the right file? I don't know. Please tell me if you do. The solution So after Googling for a while I found this article on MSDN, and things started to make sense. But first let me show you what it looks like on my computer. The file causing my headaches are Contiki.Windows.Application.exe.config. Do you see when it's modified? 08:56 this morning, but the file that is being opened is from 13th of April! How do I know? Well, if you have a look at the virtualized files which you'll find in C:\Users\Username\AppData\Local\VirtualStore\[Your path], it might help out. So I looked at C:\Users\1jontor\AppData\Local\VirtualStore\Program Files\CMA Contiki AS\Contiki ECM and found this: Modified back in April. I opened this file and it was exactly what I saw in TextPad. But this file is the same both in TextPad and Notepad!  Explorer gives you a shortcut to the Virtual Store folder if any files are virtualized, and will show this button in Explorer:  The end A couple of notes from the MSDN article: "When you enumerate resources in folders and in the registry, Windows Vista will merge global file/folder and registry keys into a single list. In this merged view, the global (protected) resource is listed along with the virtualized resource." "The virtual copy will always be present to the application first.... even if [some file] is updated" Even if the file is updated!? Who though of that? Was that really such a good idea? I can see what they where thinking, but it would have saved me a lot of work getting an error message saying "Access denied"... To end this off I picked another good quote from the article: "Microsoft intends to remove virtualization from future versions of the Windows operating system as more applications are migrated to Windows Vista." I appreciate that... 
Thursday, February 21, 2008
Before installing SP1 I could right click anywhere in Windows Explorer and select search to do searches in that folder. After SP1 it's gone! Why? Blame "us" (the Europeans or actually EU). They (I say they, because Norway is not part of EU ) found a "new" game to play with MS. It's called Antitrust and it's about Suits meeting up in in European courts to talk about software. Browsers are especially popular, but sometimes they talk about other types of software as well. The looser of the Game (usually MS) have to become agile and change their software so the Europeans can get their price. This time MS didn't want to play, so they just gave the EU the price. What's the price you might ask? A pluggable search architecture. If you are a provider of a desktop search engine, users can now set your search engine as default search in Windows. So what if I want to have the contextual search like it was? Then you can change a registry key as described here or just use Windows key + F as I do.
Saturday, February 16, 2008
As mentioned on the Vista blog, Microsoft changed their mind regarding the release date of Vista. The original statement was that it would not be available until mid march (though it was already in RTM). You can now find the download at MSDN Subscriber Downloads. You'll will not find it in your normal subscriber download page, but on the front page where you have a list of Top Subscriber Downloads, like this: I installed SP1 Friday night and it took it's time, but there were no problems. My first concern was if all my drivers would still work after installation, or if I had to reinstall some of them (as mentioned on the Vista blog). After initial boot everything was fine so no problems there. The next morning however I went out for 30 minutes leaving my laptop on. When I came back it had restarted. I inspected the System log only to find this: The previous system shutdown at 10:29:45 on 16.02.2008 was unexpected. Nice! In the Security log the only trace I could find of a shutdown was this: Audit events have been dropped by the transport. The real time backup file was corrupt due to improper shutdown. I'm quite sure that this was not related to any external event (like power failure or the like). If it was, my laptop would still be turned off when I came back. I really hope this was a one time incident and that I don't have to worry about this in the future.
Wednesday, February 06, 2008
Vista Service Pack 1 is now finished. The Vista team announced on their blog that they now have released SP1 to manufacturing (RTM). They also say that: "...we have made great progress in performance, reliability and compatibility." and "...copying or moving files around your PC, your home network or your corporate network should now be much faster -- up to 50% faster in some scenarios (according to our internal tests)." This has annoyed me a lot on my HP: "In addition, on many kinds of hardware, resuming a Windows Vista-based PC from sleep is faster on Service Pack 1." So when and where can I download? It will be available trough Windows Update in mid March (and auto download in mid April if you have this enabled). So why not today? During beta testing some issues was found related to some device drivers "that did not follow our guidelines for driver installation". So the next month will be used to: "...giving us time to work with some of our hardware partners to make adjustments to the installation process for the affected drivers." If you don't want Vista to update itself to SP1 when it's available, check out my previous post on how to block the update.
Sunday, February 03, 2008
Jens Schaller has started to write some Vista tips/tricks/tweaks. He's written 3 great tips (1,2,3) for now and will be doing one for each day in February. I immediately started using Ctrl+Shift+Enter to open apps in admin mode! Looking forward to the other ones already.
Sunday, December 23, 2007
SP's are a necessity, but what I want to know is what have they done to improve IIS 7? Here's what the release notes for SP1 RC says: IIS was included in some Windows Vista SKUs to enable web-based developers to write and test their applications. IIS in Windows Server 2008 is a significant server role which requires Internet-level scalability and performance requirements. The IIS7 components have gone through significant performance and reliability enhancements since Windows Vista originally shipped, in order to be a large-scale server component. These changes do not affect most Windows Vista users who do not even have the IIS7 components installed, however because Windows Vista and Windows Server are aligned, these changes are included in Windows Vista SP1. You can find the "complete" change log here: http://technet2.microsoft.com/windowsvista/en/library/005f921e-f706-401e-abb5-eec42ea0a03e1033.mspx?mfr=true So does this mean that there is a full UI and ftp support? The current IIS available in Vista is very limited by this. You can configure most of the stuff in config files (like I did with http redirect and logging bandwidth and referrers), but I would at least expect the features found in IIS 6 to be available from the UI in IIS 7. I've googled around to find some more info, but nothing yet. I guess I'll have to install the RC to find out. Not sure if I want to risk it though...
Soon Windows Vista SP1 will be available for download. Or actually, it might even decide to automatically update itself, even though you specifically told it not to! However, not all of us want this to happen without our knowledge (or want to wait until some unexpected behaviors has been discovered), so Microsoft has release a service pack blocker. This blocker will also work for Windows XP and Windows Server 2003. The blocker only work for a set period of time. Mary Jo Foley has more details in her blog.
Saturday, March 24, 2007
If
you’ve installed Office 2007 yet, you’re probably aware of the new preview
feature in Outlook. By default all Office attachments can be previewed inside
Outlook. Thanks to Ryan Gregg you can now preview PDF documents as well. Go
check it out!
Wednesday, February 21, 2007
I'm using SmarterStats for my blog statistics and have been annoyed by two things for a while. I get no statistics for bandwidth and referers. I looked around on the web and found that these things are actually not logged in IIS by default. I found this article describing how to enable it in IIS 6. Now I had to find out how to do the same thing in IIS 7. As I and others have mentioned earlier, IIS 7 in Vista don't have much UI yet, so most of the work is done in config files. I checked out the schema and came up with this: <sites> <site
name="Default Web Site" id="1"> <application
path="/" applicationPool="ASP.NET 1.1"> <virtualDirectory
path="/" physicalPath="…" /> </application> <bindings> <binding protocol="http" bindingInformation="*:80:" /> </bindings> <logFile
logExtFileFlags="Date, Time, ClientIP, UserName, ServerIP, Method, UriStem,
UriQuery, HttpStatus, Win32Status, ServerPort, UserAgent, HttpSubStatus,
BytesSent, BytesRecv, Referer" />
</site>
</sites>After these changes I went into SmarterStats and found values for both bandwidth and referers. Fantastic!
Friday, December 29, 2006
As one of Microsoft latest publicity efforts they offered Joel Spolsky (Joel on Software) and other bloggers a new Ferrari laptop with Windows Vista to keep, in return of his opinion of Windows Vista. They got what they bargained for and a bit more. Check out his latest blog post to get the details.
I must say I admire Joel as one of our best bloggers out there and he really knows how to attract an audience. I’m not sure if I have dared to blog about this in the same way as Joel and I'll give him credit for that, but why on earth did Microsoft offer him this deal if they knew who he was? I’ve read quite a bit of his work including his Joel on Software book and this is not the first time he’s brutally honest about these things. I remember quite a few references back to the Excel team where he once worked at Microsoft. Very interesting reading. Anyway my humble opinion is that this happens all the time and I guess it’s up the each and every one of us to decide for our self what to do. I agree with Joel in great extent, but as I said I don’t think I would have blogged about it. But that’s probably why he has a trillion readers and I have 7. But at least I got a brand new hot tub 6 months ago… Still waiting for that Ferrari though... Yeah, in
my dreams!!
Wednesday, December 27, 2006
When I moved my blog from Blogger to DasBlog I wanted to keep rss.xml and atom.xml, and redirect them to the new DasBlog url’s. I googled a bit but didn’t find much. And the ones I found I wasn’t able to use (maybe because I’m running Vista RC2). Anyway, last night enough was enough and I decided to put this to an end. I started to look at IIS’s config file applicationHost.config (usually found at C:\Windows\System32\inetsrv\config) and one section got my attention: <httpRedirect enabled="false" />
The problem was finding schema documentation for
this element. After a while I found this (http://www.iis.net/default.aspx?tabid=2&subtabid=25&i=946&p=24).
To solve my problem I used this: <httpRedirect enabled="true"
exactDestination="true”
httpResponseStatus="Permanent">
<add
wildcard="/rss.xml"
destination="/SyndicationService.asmx/GetRss" />
<add
wildcard="/atom.xml"
destination="/SyndicationService.asmx/GetAtom" />
</httpRedirect>So if you have a similar problem I hope this
helps.
Update: I upgraded to Vista Release and suddenly the redirect didn't work anymore. I tried and tried and tried and gave up. I tried again and came over this: | That
nailed it. Don't know why I didn't see this before, but it would be nice
though if the error message said something about enabling this feature. |
Friday, November 17, 2006
Just got the message from MSDN Subscriptions that Windows Vista is now available at MSDN Subscriber Downloads. The download is very slow though…
Monday, October 02, 2006
 On Sunday I started installing Windows Vista on a computer I have running at home. My initial thought was just to test the OS, install some software and take it from there. But when I started playing around with IIS 7 I could not resist publishing my blog on my new OS. And it works great. Vista seams quite stable (no problems so far), but my greatest worry is my ISP and my wireless home network connecting my computer to the Internet. When that is said, please let me know if my blog stops responding :)
|
| |
|
|
|
|
| |
| August, 2010 (2) |
| June, 2010 (3) |
| April, 2010 (2) |
| March, 2010 (2) |
| February, 2010 (3) |
| January, 2010 (4) |
| December, 2009 (1) |
| August, 2009 (4) |
| July, 2009 (4) |
| June, 2009 (2) |
| May, 2009 (4) |
| April, 2009 (7) |
| March, 2009 (7) |
| February, 2009 (4) |
| January, 2009 (4) |
| December, 2008 (7) |
| November, 2008 (1) |
| October, 2008 (6) |
| September, 2008 (7) |
| August, 2008 (4) |
| July, 2008 (3) |
| June, 2008 (7) |
| May, 2008 (7) |
| April, 2008 (5) |
| March, 2008 (3) |
| February, 2008 (9) |
| January, 2008 (3) |
| December, 2007 (4) |
| November, 2007 (10) |
| October, 2007 (10) |
| September, 2007 (2) |
| August, 2007 (6) |
| July, 2007 (6) |
| June, 2007 (3) |
| May, 2007 (2) |
| April, 2007 (8) |
| March, 2007 (6) |
| February, 2007 (5) |
| January, 2007 (10) |
| December, 2006 (9) |
| November, 2006 (5) |
| October, 2006 (8) |
| September, 2006 (5) |
|
|
 |
 |
|
|