views:

379

answers:

3

I built a little installer, which installs to program files. I run the installer and all is good, run the installed .exe and it just disappears. I guess at giving the EXE admin launch rights in Vista and it runs. But why is this needed? This can't be normal can it?

+1  A: 

What version of Inno Setup are you using?

http://www.vincenzo.net/isxkb/index.php?title=Vista_considerations

This states you need 5.3.7 for standard-user-only installs as a minimum. It also defines which things you can and can't do for a standard user installer.

Joe
5.3.8... but it turns out I need admin-level install. The issue was without that, I simply didn't know the .exe needed it... rather than complain it just quit.
John
+1  A: 

It may be your application that is crashing, and completely unrelated to Inno Setup. Bear in mind that if your application is installed to Program Files, it can read but cannot modify files inside the installation directory without administrator privileges.

You should instead use the AppData\Roaming folder. Perhaps your application is falling over an unhandled exception while writing to a file while access to it is denied?

Edit:

To have Inno remove the restrictive permissions on your installation directory, add the following to your Inno Setup script:

[Dirs]
Name: "{app}\"; Permissions: everyone-modify
Paul Lammertsma
It's not an Inno problem, but I expected the installer to sort this out. Joe's link may have helped. The issue is almost certainly that the app tries to modify a file in its own dir, which requires admin access.
John
You can have Inno change the permissions on the installation directory so that administrative privileges are not required. I'll update my answer in a moment with the setup script.
Paul Lammertsma
Is Inno able to do this even on Windwos folders like Program Files\MyApp?
John
Yes, it is! The permissions on the Program Files folder can be modified with administrator privileges, so if you grant the setup application permission via a UAC dialog, it can modify them.
Paul Lammertsma
A: 

If your application requires full administrator privileges in order to run correctly, you might consider bundling a manifest file with your executable, containing:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <v3:trustInfo xmlns:v3="urn:schemas-microsoft-com:asm.v3">
    <v3:security>
      <v3:requestedPrivileges>
        <v3:requestedExecutionLevel level="highestAvailable"/>
      </v3:requestedPrivileges>
    </v3:security>
  </v3:trustInfo>
</assembly>

This can be done fairly easily from many IDEs, but if you already have an executable and only want to associate a manifest file with it, this article describes the best practices in doing so.

Paul Lammertsma