Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2007
    Posts
    19

    Grin Reame file after install

    I need to rename a file after (or before) installing it. This file is a main file and is in the archive and also gets shortcuts (quick launch, start menu).

    I do it like this right now:
    Code:
    IFileRenamed = SessionVar.Expand("%AppFolder%").."\\IDemo-"..PrepINum()..".exe";
    File.Rename(SessionVar.Expand("%AppFolder%").."\\IDemo.exe", IFileRenamed);
    I also added an option to run the file after install and I use the new name variable to file.run so this is all working correctly but the problem is that I also need to update the following with the new name, how do I do that?
    • shortcuts on system
    • uninstall data
    • i think there might be more..

  2. #2
    Join Date
    Jan 2000
    Posts
    2,002
    Before we get into that, let me ask you this - do you know the value of PrepINum() before you build the install? If so, use a build constant at design time rather than a script at runtime.

    If you can only get that value at runtime, then you will have to use the actions to create the shortcut instead of the checkbox on the properties dialog. The uninstall can be modified using the UninstallData actions.

  3. #3
    Join Date
    Oct 2007
    Posts
    19
    The function is in the global functions and can change everytime. It returns a numeric value (eg. 1201). The value is determined before any user action is needed, eg. the value is known at startup but not before.

    I looked at uninstall data functions and there doesn't seem to be an update, but I will just do a remove then add again with the new name.

    How do I create shortcuts though?

  4. #4
    Join Date
    Jan 2000
    Posts
    2,002
    You create a shortcut with the Shell.CreateShortcut action. You can add the shortcut to the uninstall using the UninstallData.AddItem action.

    There are a couple of ways to have the dynamically named file removed during uninstall:

    1. Use UninstallData.AddItem to add an entry for the new filename. DO not worry about removing the old one - it will have no effect.

    2. Write the name of the file to the Registry or an ini file and then in your uninstall script, read it back in and use a File.Delete action to remove it.

Similar Threads

  1. Silent install cannot copy file ....
    By peteryen in forum Setup Factory 7.0
    Replies: 5
    Last Post: 08-26-2007, 05:57 AM
  2. Searching for a file and overwrite it with docs file
    By Wonderboy in forum AutoPlay Media Studio 6.0
    Replies: 32
    Last Post: 03-23-2006, 06:59 AM
  3. Rename file before install?
    By toad32 in forum Setup Factory 6.0
    Replies: 8
    Last Post: 01-30-2003, 09:00 AM
  4. HOWTO: Limit the Number of Times an Install can be Run
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-17-2002, 02:58 PM
  5. HOWTO: Conditionally Install Files Based on OS
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-10-2002, 03:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts