Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6939865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:40:44+00:00 2026-05-27T12:40:44+00:00

In install4j, we can set the Overwrite policy for a file If newer, otherwise

  • 0

In install4j, we can set the Overwrite policy for a file “If newer, otherwise ask”, or “Always ask”, etc..

I want to upgrade an application which has a .properties configuration file that end users can edit. In newer versions, some properties will be added, but we don’t want to update customized existing properties.

So I’d set the Overwrite policy to “never”, and create a custom action to merge the new properties in. I could use the “Append text to a file”, but I’d like to do it more dynamically, by comparing the old and the new file, and only append those properties whose keys do not exist in the old file.

So my questions:

  1. Can I detect if the action is called during an install or an upgrade?
  2. How can I get the content of the new file if it didn’t overwrite the old file?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:40:45+00:00Added an answer on May 27, 2026 at 12:40 pm

    Can I detect if the action is called during an install or an upgrade?

    Yes, you can use

    context.isUpdateInstallation()
    

    in condition expressions or other scripts.

    How can I get the content of the new file if it didn’t overwrite the old file?

    If a file is not installed, the content is not accessible. I would suggest the following:

    1. Install the properties file to a different path
    2. In the case of a new installation, copy it to the target path with a “Copy files” action
    3. In the case of the upgrade installation, merge the properties files
    4. In all cases, delete the template file from step 1 with a “Delete files” action
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way that I can set my kernel Makefile flags to always
How can I set where Perl looks for modules in Apache httpd.conf file on
I have set of scripts for doing scripted installs. You can use the scripts
I have installed apache-tomcat-6.0.35-windows-x86 in my system. How can I configure it and set
I've got a ClickOnce application deployed that many machines can install just fine -
When I install packages in linux environment I can set the automatic 'yes' option,
I understand that in the Air for IOS settings you can set the Resolution
Hi i want to set JList height as height as screen is public Locations()
Can anyone tell me the difference in how an application is delivered and installed
How can I set a key binding that globally overrides and takes precedence over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.