Cannot install files in c: \ Program in Windows 7

I have an installer written in Java using Izpack. It works fine on Windows XP, however on Windows 7 it cannot write to c: \ Program Files. Oddly enough, as the user running this installer, I can create folders under c: \ program files, but not from the installer itself.

What am I missing?

+8
windows-7 permissions
source share
5 answers

in order to record this path, the installer will need to request and provide startup as an administrator.

For Java: Run the CMD prompt as an administrator or powershell as an administrator and go to JAVA Bin dir .... and run java.exe -jar # The full path to the jar file that will receive it in a private message

+6
source share

add

<run-privileged/> 

in the info part of your installer.xml.

For example::

 <info> <appname>IzPack</appname> <appversion>4.2.0</appversion> <authors> <author email="" name="Julien Ponge (project founder)"/> <author email="" name="The fantastic IzPack developers and contributors"/> </authors> <url>http://izpack.org/</url> <javaversion>1.5</javaversion> <requiresjdk>no</requiresjdk> <run-privileged condition="izpack.windowsinstall.vista|izpack.macinstall"/> <summarylogfilepath>$INSTALL_PATH/installinfo/Summary.htm</summarylogfilepath> </info> 
+2
source share

You need to run the installer as admin. Only an administrator can write to the Program Files directory. Usually, when a user tries to make changes, the UAC asks if you are sure. This is not necessarily true for the program.

+1
source share

Have you tried using the option "Run as" ... "Administrator"?

+1
source share
  1. Run cmd with administrator privileges
  2. java -jar ***. jar
0
source share

All Articles