Skip to content
⌘ NSIS Forum Archive

Vista detect installation unsuccessful

11 posts

Voseldop#

Vista detect installation unsuccessful

After install i have Vista dialog, asking me about installation result. How can i supress this dialog?

Do you have any solutions? What should i do in my installer?
onad#
Since I managed to create a NSIS installer without dialog on Vista, are your sure you installer is working correctly and adheres to installer best practices?

Best is just to compile a NSIS example and install and test this on Vista.

Make sure you understand elevated rights on Vista.
onad#
In your case you need probabbly to ad a manifest for setting privileges in Vista see below:

Creating an Application Manifest
An application manifest is an eXtensible markup language (XML) file that contains the attributes that describe the application's requirements to the operating system. The following sample shows how to use the requestedExecutionLevel element in the application manifest to ensure that the application runs with elevated privilege.
The terms in italic type should include application specific data. The version, name, and type attributes are mandatory. Otherwise, this sample is complete.

<?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="OEM.Division.Model"
type="win32"/>

<description>Description of your application</description>

<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

When the level of the requestedExecutionLevel element is requireAdministrator, Windows Vista asks the user to elevate the privilege level before it runs the application. The uiAccess attribute should be false, as shown in the previous example, for a printer Setup application.
For more information, see the paper titled Developer Best Practices and Guidelines for Applications in a Least Privileged Environment. The schema in the application manifest is described in the Platform SDK.
Marking the Application with the Manifest
Mark the application by using the mt.exe tool. Mt.exe is part of the platform SDK, which can be downloaded from MSDN.
For example, if the application manifest file name is oem.manifest and the application is called setup123.exe, you would use the following command to mark the application with the manifest.
mt -manifest oem.manifest -outputresource:setup123.exe;#1

After running this mt command, Setup123.exe automatically requests permission from Windows to run with elevated rights when it is run on a Windows Vista computer.
Verifying the Change
Verify that the application was successfully marked by running the application. If the application has been marked correctly, Windows automatically displays the User Account Control dialog box to request that the application run with administrator privileges.
Marking the application also modifies the application icon by overlaying the Windows Vista shield icon on the application icon.
Clammerz#
onad, thank you for the great information.
How do we go about doing this for the uninstaller too?
Or will modifying the setup manifest apply for the uninstaller too?

Thank you very much for your time.
onad#
Vista OS is "smart" in a way if it detects *SETUP* or *INSTALL* in a filename it expect that it needs elevated rights anyhow,

(* is a wildcard)

Have not tested myself by calling your un-installer

unsetup.exe or uninstall.exe could do the trick also.

For the rest put a request in the defect(bug) tracker where you request that this resource is added by default.

( Someone might complain that the (un)install will get about 500 Bytes bigger by default 😉

Else take the NSIS source, modify by adding the resource and recompile.

Since I have not much time (Vista Vista Work 🙁 I can not do this for you.
onad#
Oh and adding the file that is attatched here in the unins.exe folder might help.

TIP Search the Web for info about .manifest files on XP
onad#
for understanding Windows Vista UAC to improve your NSIS installers:

http://www.microsoft.com/technet/win...at/uaprot.mspx
ckm#
Onad,
I followed your suggestion but could not make my unstaller work on Vista. I am not able to write the manifest file into the isntaller using MT.exe so i am shipping the manifest file also along with uninstaller.

I renamed the unisntaller in the NSI to generate MainUni.exe (Just for testing) and used the same manifest file with one change (requestLevlel set to highestAvailable) and when i click on Mainunit.exe (unisntaller) it gives NSIS error and in the tempp file i see A~NSIS.exe to Z~NSIS.exe files. Could you please share the sample with use. Note my installer doesn't require any admin rights and i am testing mine using Standard USers.

Thanks for any help /hints
-Chetan
davhunt#
I think one of the reasons the dialogue might come up saying it thinks something went wrong with the installation might be that it didn't see any changes in (HKLM or HKCU)\Software\Microsoft\Windows\CurrentVersion\Uninstall\

As for the manifestation solution, there are some tricky things about tweaking resources. Many resource editors will obliterate any 'end of file' data - which is where your actual installation information is probably living inside your setup file.

I think you might have more luck with CVS. Try playing with the RequestExecutionLevel option. In this case, I think:
RequestExecutionLevel user
might do the trick. [none and admin are the other two options I see in that tokens.cpp file].
kichik#
As for the manifestation solution, there are some tricky things about tweaking resources. Many resource editors will obliterate any 'end of file' data - which is where your actual installation information is probably living inside your setup file.
For that you have !packhdr which is executed before the "end of file" data is written.

The latest CVS version indeed supports embedding the manifest using RequestExecutionLevel.