[izpack-user] Uninstaller issue

480 views
Skip to first unread message

Mario Burdman

unread,
Jul 29, 2014, 12:48:57 PM7/29/14
to us...@izpack.codehaus.org
Hi guys,

I have problems with uninstaller on windows 8.

It removes the shortcuts and icons but not the folder inside "program files".
I already had problems with installer and I gues is the same problem, permission denied for java -jar, it should be run as admin.

Any thoughts? Should I consider to move to version 5? Is it more Windows 8 ready than 4?

Thanks

--
Mario

Miles Tjandrawidjaja

unread,
Jul 29, 2014, 2:12:51 PM7/29/14
to us...@izpack.codehaus.org
Hello Mario,

I also recently encountered this issue but on Linux, but its likely that the problem has the same root cause.
For me the issue arises because uninstaller is not getting rid of the ".installationinformation" file and the "auto-install.xml".
Since the directory is not empty the uninstaller does not allow you to remove the directory (which is a good thing), unless you use force.
I think the information provided about "permission denied" is not accurate, it probably says this because if you create a installer that required privileged rights, the uninstaller will still let you to attempt and uninstall. I have tried to address this recently http://jira.codehaus.org/browse/IZPACK-1045.
I will most likely look into fixing this soon.

Regards,
Miles Tjandrawidjaja

----- Original Message -----
> Hello Mario,
>
>
>
> Regards,
> Miles Tjandrawidjaja
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Paul Bors

unread,
Jul 29, 2014, 8:49:32 PM7/29/14
to us...@izpack.codehaus.org
Why not simply configure your install.xml descriptor not to generate said files via:
<info>
<appname>[Your app name]</appname>
<appversion>${project.version}</appversion>
<url>[Your app URL]</url>
<authors><!-- izPack now gets them from the POM :-) --></authors>
<javaversion>[x.y]</javaversion>
<run-privileged condition="izpack.windowsinstall"/>
<uninstaller write="yes" />
<writeinstallationinformation>no</writeinstallationinformation> <!— Do not write installer info —>
</info>

Also, since izPack is Open Source, please attach your GitHUB push request to the Jira ticket.

Paul Bors

unread,
Jul 29, 2014, 9:05:30 PM7/29/14
to us...@izpack.codehaus.org
Also, you can write your own custom Java code to perform the clean-up via install and uninstall listener (read the user manual).

Create your own maven module and compile it as a jar, then add it to the installer via:
<jar src="${events.dir}/my-installer-events.jar"   stage="uninstall" />

Then inside the my-installer-events.jar have your own class extend com.izforge.izpack.api.event.AbstractUninstallerListener and feel free to extend whatever method you want like beforeDelete() afterDelete() etc. You can do the same for the installation just change the stage (normally I do that for my own custom panels not just events).

Here’s couple of help links for you guys.

Maven plugin to compile your installer:

Custom actions (events) at uninstallation (don’t forget this uninstaller is generated at the end):

Running with elevated privileges on Windows:

Do not write the installation data:

Perhaps the most important, how to debug (trace your code) your installers/un-installers remotely:

Have fun!

Mario Burdman

unread,
Jul 29, 2014, 9:50:07 PM7/29/14
to us...@izpack.codehaus.org
Thank you Paul, I'll take a look to "Running with elevated privileges on Windows:"

--
Mario

Paul Bors

unread,
Jul 29, 2014, 11:38:16 PM7/29/14
to us...@izpack.codehaus.org
That’s your install.xml

<info>
    …
    <run-privileged condition="izpack.windowsinstall”/>
    …
</info>

I also advise adding <writeinstallationinformation>no</writeinstallationinformation> since you don’t want the user’s sensitive input in that file (say save passwords in clear text on the HD).

Mario Burdman

unread,
Jul 30, 2014, 8:05:11 AM7/30/14
to us...@izpack.codehaus.org
hmmm... I don't think that "Running with elevated privileges on Windows:" is usefull in for this issue, maybe is helpful to not to have to provide indications like "do right click and run as admin", but thats it right? I still need an exe wrapper, and this only applies for installer, not uninstaller.

Miles, nothing is removed from program files, it looks like the issue is with windows 8. This story started when the customer wasn't able to install the program and I found that I need to do an exe wrapper to allow "run as administrator" contextual menu. 

The problem is that my app, if the user select "copy files to disk"  when install, I copiy 4GB to the disk! so, unisntaller must remove that, will take a look to AbstractUninstallerListener.

I wonder if I could create an exe wrapper also for uninstaller.jar and run somehow as admin, tweaking/customizing the uninstaller shortcut when the program installs...

Thanks for the help


--
Mario

Paul Bors

unread,
Jul 30, 2014, 3:21:57 PM7/30/14
to us...@izpack.codehaus.org

Well, the unibstaller jar is created as the last step of the installation. Any other files created by your app must be cleaned up via an unubstaller listener.

I think you can overcome your uninstaller as admin requirements by writing the appropiate registry keys for the uninstaller to start from Add/Remove Programs or whatever is called now-a-day in win8.

You dont need exe wrappers in the ubibstaller, simply call cmd.exe in your own process and delete the folders you want or handel it in Java.

You could start another process via cmd.exe and escalate its right to admin. It shoukd promt the user to acept the right elavation.

I do belive that run with elavated privaledges should work for the ub j bstaller, i dont recall top of my head.

Reply all
Reply to author
Forward
0 new messages