Skip to content

Commit

Permalink
Simpler implementation: set path to user dir if normal user, set path…
Browse files Browse the repository at this point in the history
… to program files if admin user
  • Loading branch information
simonharrer committed Apr 7, 2016
1 parent 60098c4 commit 88f3ef1
Showing 1 changed file with 3 additions and 72 deletions.
75 changes: 3 additions & 72 deletions jabref.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -159,39 +159,17 @@
</serializedBean>
<condition>context.getBooleanVariable("sys.confirmedUpdateInstallation")</condition>
</action>
</actions>
<formComponents />
</screen>
<screen name="" id="178" customizedId="" beanClass="com.install4j.runtime.beans.screens.FormScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.screens.FormScreen">
<void property="subTitle">
<string>Choose for which users you want to install Jabref.</string>
</void>
<void property="title">
<string>Installation Scope</string>
</void>
</object>
</java>
</serializedBean>
<condition />
<validation />
<preActivation />
<postActivation />
<actions>
<action name="" id="184" customizedId="" beanClass="com.install4j.runtime.beans.actions.control.RunScriptAction" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" multiExec="true" failureStrategy="1" errorMessage="">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.control.RunScriptAction">
<void property="script">
<object class="com.install4j.api.beans.ScriptProperty">
<void property="value">
<string>int selection = (int) context.getVariable("installForAllUsers");
if (selection == 0) {
<string>if (Util.hasFullAdminRights()) {
context.setInstallationDirectory(context.getInstallationDirectory());
} else {
context.setInstallationDirectory(new File(System.getProperty("user.home")));
context.setInstallationDirectory(new File(System.getProperty("user.home"), "JabRef"));
}
return true;</string>
</void>
Expand All @@ -203,54 +181,7 @@ return true;</string>
<condition />
</action>
</actions>
<formComponents>
<formComponent name="" id="181" customizedId="" beanClass="com.install4j.runtime.beans.formcomponents.MultilineLabelComponent" enabled="true" commentSet="false" comment="" insetTop="" insetLeft="" insetBottom="" insetRight="" resetInitOnPrevious="false">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.formcomponents.MultilineLabelComponent">
<void property="labelText">
<string>Select whether you want to install JabRef for yourself or for all users of this computer.
Note: An installation for all users requires admin privileges.</string>
</void>
</object>
</java>
</serializedBean>
<initScript />
<visibilityScript />
</formComponent>
<formComponent name="" id="183" customizedId="" beanClass="com.install4j.runtime.beans.formcomponents.SpacerComponent" enabled="true" commentSet="false" comment="" insetTop="" insetLeft="" insetBottom="" insetRight="" resetInitOnPrevious="false">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.formcomponents.SpacerComponent" />
</java>
</serializedBean>
<initScript />
<visibilityScript />
</formComponent>
<formComponent name="" id="182" customizedId="" beanClass="com.install4j.runtime.beans.formcomponents.RadiobuttonsComponent" enabled="true" commentSet="false" comment="" insetTop="" insetLeft="" insetBottom="" insetRight="" resetInitOnPrevious="false">
<serializedBean>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.formcomponents.RadiobuttonsComponent">
<void property="radioButtonLabels">
<array class="java.lang.String" length="2">
<void index="0">
<string>Install for everyone using this computer</string>
</void>
<void index="1">
<string>Install just for me</string>
</void>
</array>
</void>
<void property="variableName">
<string>installForAllUsers</string>
</void>
</object>
</java>
</serializedBean>
<initScript />
<visibilityScript />
</formComponent>
</formComponents>
<formComponents />
</screen>
<screen name="" id="4" customizedId="" beanClass="com.install4j.runtime.beans.screens.InstallationDirectoryScreen" enabled="true" commentSet="false" comment="" actionElevationType="inherit" rollbackBarrier="false" backButton="2" finishScreen="false" wizardIndexChangeType="unchanged" wizardIndexKey="">
<serializedBean>
Expand Down

0 comments on commit 88f3ef1

Please sign in to comment.