开发者

Inno Setup... app crashes silently if not run as Admin

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 no开发者_开发百科rmal can it?


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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜