+ Reply to Thread
Results 1 to 4 of 4

Thread: Change output [EXENAME] dynamically

  1. #1

    Default Change output [EXENAME] dynamically

    We need to automatically assign the output executable to include a version within the filename.
    For example: compile the .sbp and generate Setup001.exe. Then when we have a new version run the compiler again and generate Setup002.exe.

    I added the ability to call a dll which generates a new filename with the version embeded in it where my local variable %NEWBUILDNAME% contains the characters 'Setup003.exe'

    Then, use that variable to assign it to [EXENAME] so the compiler generates a dynamically named setup file.
    If my outputdir was C:\Temp\ and [EXENAME] was set to %NEWBUILDNAME%, the filename ends up being:
    C:\Temp\%NEWBUILDNAME instead of using the value within the variable.

    I have even tried #copy and #rename set with Process After Script Compilation and it is the same result.

    Thanks in advance.
    Carl

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Change output [EXENAME] dynamically

    Carl,

    my first idea was to use this built-in feature:

    http://www.lindersoft.com/forums/sho...-Build-Numbers

    But you are not using a "standard" version numbering format, so this can't be used here. It would create "Setup0.0.0.2.exe" instead of your "Setup002.exe" format.

    Here is another possible method, but it does not fit your needs:

    http://www.lindersoft.com/forums/sho...installer-name

    By the way, your DLL technique did not work because %NEWBUILDNAME% is a runtime variable. This is only available when you run the setup.exe and is not valid when you compile a setup.exe.

    I have developed a helper application with SetupBuilder for you. I have uploaded both the helper source code and the demo project to:

    http://www.lindersoft.com/projects/A...ementSetup.zip

    The non-elevated running helper application ("increment.exe") is called from your main project and auto increments the build number when you compile the project. The last build number is stored in the "build.txt" ASCII text file.

    See attached screenshots.

    1. Add the Lines 16-18 from the "setup_build_demo.sbp" project file to your main project.

    2. Set the "Executable Name [EXENAME]" in your main project (General Information -> Product Properties) to setup[MY_SETUP_BUILD].exe

    3. Copy the "increment.exe" helper application to the same folder where your main project .sbp file is located.

    4. Compile your project.

    Does this help?

    Friedrich
    Attached Images Attached Images     

  3. #3

    Default Re: Change output [EXENAME] dynamically

    Thank you very much for the suggestions.
    Since we use a resource file and set the File Version and Product Version for each build, it worked out perfectly to use the Value From Resouce example.

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Change output [EXENAME] dynamically

    Perfect! Thanks for the update.

    Friedrich

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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