locked
replacing permanent files RRS feed

  • Question

  • I built a setup application in vs 2008 a while back.  In the installation, I included a default .ini file that is modified by the user.  I marked it as permanent so that on subsequent releases of the software would not delete the modified file.  Now with an increase in functionality required by the application, I was asked to modify the actual ini file.  Because I marked it as permanent in the install, the new updated file will not get installed over the ini file already on the target machine.  I do understand why this is happening but I was wondering if there was any way around this.  I have been searching for a little while but havent come up with much.   Any help would be appreciated

     

    Thanks in advance

     

    Monday, March 21, 2011 4:35 PM

Answers

  • Hi meriano,

    Welcome to the MSDN Forum.

    About the property: permanent, the MSDN described as:

    Specifies whether a file, assembly, or project output group should be removed from a target computer when the application is uninstalled. By default, all items are removed during uninstall.
    False: The selected item is removed when the application is uninstalled. 
    True: The selected item is not removed when the application is uninstalled. It remains on the target computer until it is manually deleted.

    I think the property will not provent you to upgrade it. Or you can write a method in your main application and when start the application which is updated, check the ini file and fix it if it is not the new version.

    If you have any questions, please feel free to let us know.

    Best Regards


    Neddy Ren [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Proposed as answer by Neddy Ren Friday, March 25, 2011 1:06 AM
    • Marked as answer by Neddy Ren Monday, March 28, 2011 2:49 AM
    Wednesday, March 23, 2011 7:21 AM
  • "Permanent" should not mean "can never overwrite", so it's not clear to me what's going on here.

    http://msdn.microsoft.com/en-us/library/aa368007(v=VS.85).aspx 

    In the Attributes section, Permananent and Never Overwrite are different, and Visual Studio setups just set Permanent.

    The overwrite rules are here:

    http://msdn.microsoft.com/en-us/library/aa370531(v=VS.85).aspx 

    so I suspect maybe the problem is that the file has been modified and won't be replaced. I suggest you use a custom action to modify the ini file with the new data.


    Phil Wilson
    • Proposed as answer by Neddy Ren Friday, March 25, 2011 1:05 AM
    • Marked as answer by Neddy Ren Monday, March 28, 2011 2:49 AM
    Wednesday, March 23, 2011 5:05 PM
  • Visual Studio setups don't provide support for the feature that lets a data file follow the version rules of a versioned binary (companion files).

    A custom exe to edit the ini file should work fine.


    Phil Wilson
    • Proposed as answer by Neddy Ren Friday, March 25, 2011 1:05 AM
    • Marked as answer by Neddy Ren Monday, March 28, 2011 2:49 AM
    Thursday, March 24, 2011 11:04 PM

All replies

  • Hi meriano,

    Welcome to the MSDN Forum.

    About the property: permanent, the MSDN described as:

    Specifies whether a file, assembly, or project output group should be removed from a target computer when the application is uninstalled. By default, all items are removed during uninstall.
    False: The selected item is removed when the application is uninstalled. 
    True: The selected item is not removed when the application is uninstalled. It remains on the target computer until it is manually deleted.

    I think the property will not provent you to upgrade it. Or you can write a method in your main application and when start the application which is updated, check the ini file and fix it if it is not the new version.

    If you have any questions, please feel free to let us know.

    Best Regards


    Neddy Ren [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Proposed as answer by Neddy Ren Friday, March 25, 2011 1:06 AM
    • Marked as answer by Neddy Ren Monday, March 28, 2011 2:49 AM
    Wednesday, March 23, 2011 7:21 AM
  • Thanks for the  reply back.   The property works just as I want it to with the unfortunate exception that now I have to update the permanent file.  This is probably only going to happen this one time.  Once the new file is installed with this release of the application, only the application will be changed so there is no need to update the file again ( i hope anyway).

    You suggested a method to update the file in the main application, do you mean in the installation setup or the actual application itself.  After the point of installation, the new ini file is not available so I would not be able to perform that check.    I am not to familiar with custom actions but is there some sort of custom action I can do or maybe use the condition property of the file.  

    Thanks again

    Wednesday, March 23, 2011 12:45 PM
  • "Permanent" should not mean "can never overwrite", so it's not clear to me what's going on here.

    http://msdn.microsoft.com/en-us/library/aa368007(v=VS.85).aspx 

    In the Attributes section, Permananent and Never Overwrite are different, and Visual Studio setups just set Permanent.

    The overwrite rules are here:

    http://msdn.microsoft.com/en-us/library/aa370531(v=VS.85).aspx 

    so I suspect maybe the problem is that the file has been modified and won't be replaced. I suggest you use a custom action to modify the ini file with the new data.


    Phil Wilson
    • Proposed as answer by Neddy Ren Friday, March 25, 2011 1:05 AM
    • Marked as answer by Neddy Ren Monday, March 28, 2011 2:49 AM
    Wednesday, March 23, 2011 5:05 PM
  • Hi Phil, 

    Yes that is exactly the problem, a default file was created and installed but then gets modified by the user (per their specific network configuration/requirements) after installation.  Its a pretty lame way of configuring the environment but what the customer wants, the customer gets.  I  was leaning more towards custom action however I have no idea where to start with these. I have never really worked with them before.  I have been looking at custom action walkthroughs/tutorials and it doesnt seem to go into much detail - do I need to create an exe in order to edit the ini file?

    Thanks for you help

     

    The overwrite properties mention file versions.  I have never versioned a file (for example, a ini file), how do you do this?  


    Wednesday, March 23, 2011 7:34 PM
  • Visual Studio setups don't provide support for the feature that lets a data file follow the version rules of a versioned binary (companion files).

    A custom exe to edit the ini file should work fine.


    Phil Wilson
    • Proposed as answer by Neddy Ren Friday, March 25, 2011 1:05 AM
    • Marked as answer by Neddy Ren Monday, March 28, 2011 2:49 AM
    Thursday, March 24, 2011 11:04 PM
  • Thank you again for the response.  I will give it a shot and let you know how it works out.

    Friday, March 25, 2011 3:57 PM