views:

280

answers:

3

If I run Inno Setup compiler from a command line/batch file it creates an exe with the version information in the file name.

However, when I run from hudson (same command line) I don't get the version information.

Perhaps I am missing something.

Is this a known issue?

This is the way I am doing it in the iss script file.

#define FileVerStr GetFileVersion(SrcApp)

EDIT:

The env vars are all set for all users - not just my login - so the service has access to everything that the command line build does.

EDIT: See my answer for a resolution of this.

+1  A: 

You are likely running Hudson on Windows given the technology mentioned.

When there is a discrepancy between what happens on the command line and what Hudson does, it is often because Hudson is running as a service on Windows. This means it is running as the service user, which is distinct from your login account.

I would look for an environment variable that you have defined in your user profile that may enable this behavior, that is not being set for the service user.

Michael Donohue
Ah, yes, I have run into this before. But I am not sure how that relates to missing functionality in inno. Perhaps the tool doesn't run right because of an environment variable? I guess I can try to run hudson as a process on my user account and see what happens. I am not exactly sure how to go about that or other ways to diagnose and fix the problem if indeed that is the cause.
Tim
Yes, I am running hudson on a windows box for this particular project.
Tim
The env vars are all available to the service - nothing is being set for my local user. Other than hudson spawning the process I see nothing different.
Tim
A: 

I am not exactly sure how to describe how I "fixed" this/worked around it.

It seems the GetFileVersion() method does not use the same base path as the other part of the Inno functionality that determines where the source files/installable files are.

The SAME relative paths used for:

// this is for determining what files get put into the install image
[Files]
Source: ..\Build\ForRelease\MyExeName.exe; DestDir: {app}

and

#define SrcApp "..\Build\ForRelease\MyExename.exe"
#define FileVerStr GetFileVersion(SrcApp)

apparently do not use the same mechanism to resolve the file name/path. So what i did to work around this was to copy the exe file that contains the version info to two additional different locations (aside from ..\Build\ForRelease) - one where hudson starts the processes and also to the path where the inoo script is. (I am too lazy to figure out which one is the one that makes it all work.

Again, this works fine from my batch file but not from hudson. It is essentially a strange interaction with how Inno works I guess.

Tim
A: 

Like "tim" has said, then relative paths doesn't work as expected for defines.

#define MyAppVer GetFileVersion(SourcePath + "\..\Build\Release\MyExeName.exe")
#if MyAppVer == ""
    #error MyAppVer - Version information not found!
#endif

By prefixing with SourcePath then the relative path will start from the path where the InnoSetup-script is located.

Rolf Kristensen

related questions