How do I prevent the Install folder from being locked on Windows 7?

Comments

1 comment

  • Avatar
    juanjo

    If I understand properly, the problem is that your installer is being installed with administrator rights and the application is unpacked into a directory without permissions for regular users. If that is indeed the issue, would be possible to configure your application to write the data file into the user personal directory? Another possibility could be to create a shortcut to your application configured with

     <createShortcuts>
        <destination>${windows_folder_desktop}</destination>
        <shortcutList>
          <shortcut>
            <comment>Launches ${project.fullName}</comment>
            <name>Launch ${project.fullName}</name>
            <runAsAdmin>1</runAsAdmin>
          </shortcut>
        </shortcutList>
      </createShortcuts>
    

    Or you could grant write privileges to all users over the data file:

    <setWindowsACL>
      <action>allow</action>
      <files>${installdir}/data/datafile</files>
      <permissions>generic_all</permissions>
      <users>S-1-1-0</users>
    </setWindowsACL>
    

    You can find additional details about the usage of the <setWindowsACL> action here.

Please sign in to leave a comment.