Deployed app DNU

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Deployed app DNU

Louis Sumberg-2
In Help/About for my apps, I'd like to answer the package version info, so I
use this phrase:

MyApp class>>aboutText
    ^'<some text> Version: %1' formatWith:
        (PackageManager current packageOfClass: self) packageVersion

While it works in the image, in a deployed app I get "SearchPolicy class DNU
#caseInsensitive".

Is there a way to tell the ImageStripper not to strip out certain methods?
In this case, since it's a system method, I don't want to change the
method's category (e.g., "must not strip") or package.

-- Louis


Reply | Threaded
Open this post in threaded view
|

Re: Deployed app DNU

Louis Sumberg-2
> Is there a way to tell the ImageStripper not to strip out certain methods?
> In this case, since it's a system method, I don't want to change the
> method's category (e.g., "must not strip") or package.

Hmm, the answer to the above might not solve this particular problem, though
I'd still like to know if it's possible (for another type of problem I've
run into more than once).  I tried deploying the app again, this time
turning off a bunch of switches in the Lagoon wizard, on the chance that the
needed methods wouldn't be stripped.  This time I got an error msg: "Change
flagging disabled" which I found in
ImageStripper>>disableClassChangeFlagging, but I have no idea what this is
about or how to make it work.  Since Package is in the Dolphin package, not
the Development package, I assume it should be accessible to a runtime app,
but maybe I shouldn't assume so much *s*.


Reply | Threaded
Open this post in threaded view
|

Versioning a ToGo app (was: Deployed app DNU)

Louis Sumberg-2
I've looked at VersionResource and VersionInfo and ImageStripper to see if I
can insert (package) version info into a ToGo app, but to no avail.  It
appears that a deployed app will always have a version string of '1,0,0,1'
(picked up from the stubfile) and that, depending on how the app wants to
show the version, it'll show as either '1,0,0,1' or the Dolphin development
version (e.g., as in Notepad.exe).

ImageStripper has a private method, #versionResource:, whose comment implies
that it's possible to set version info in the deployed app, but there are no
senders.  I put a self halt into VersionResource>>updateResource since that
appeared to be another promising place, but when I went through Lagoon, it
didn't halt, so that looks like a no-go.

I used ResHacker to change the product version in the deployed app's exe,
but when running the exe, SessionManager current versionInfo
productVersionString still answers '1,0,0,1', which seemed a bit odd since I
had verified through Windows Explorer / Properties that the product version
had changed.  In any event, that'd be a cumbersome process to go through
each time one generates a new exe.

Finally, after writing the above, I tried another approach - it seems to
work, though it doesn't change the actual version info in the exe file.  I
added the following to the package's Pre-Strip Script:

    MyApp class compile: 'version ^''', (PackageManager current
packageOfClass: MyApp) packageVersion, ''''

and changed MyApp class>>aboutText to use "self version" instead of
"SessionManager current versionInfo productVersionString".

-- Louis


Reply | Threaded
Open this post in threaded view
|

Re: Versioning a ToGo app (was: Deployed app DNU)

Steve Waring-2
Hi Louis,

"Louis Sumberg" <[hidden email]> wrote in message
news:3d682809$1@tobjects....
> I've looked at VersionResource and VersionInfo and ImageStripper to see if
I
> can insert (package) version info into a ToGo app, but to no avail.  It
> appears that a deployed app will always have a version string of '1,0,0,1'
> (picked up from the stubfile) and that, depending on how the app wants to
> show the version, it'll show as either '1,0,0,1' or the Dolphin
development
> version (e.g., as in Notepad.exe).

I have been able to get this to work by:
 - Making a copy of the stub file.
 - In my SessionManager, adding a class side utility method like:

   updateVersionResource: versionResource
      "MySessionManager updateVersionResource: self versionResource"
      | versionString description |
      versionString := '1,0,0,3'.
      description := ' a Description'.
      versionResource
         fileVersion: versionString;
         productVersion: versionString.
      (versionResource stringTables values first)
         at: 'CompanyName' put: 'a CompanyName';
         at: 'FileDescription' put: description;
         at: 'Comments' put: 'a Comment';
         at: 'ProductName' put: description;
         at: 'OriginalFilename' put: 'a Filename'.

 - In "Step 7" of the Lagoon Deployment Wizard, I use the "Custom Options"
to get up an inspector on the ImageStripper, and evaluate "MySessionManager
updateVersionResource: self versionResource".

As I understand it, the "Pre-Strip Script" runs too late in the strip
sequence for this to be automatically run as a script.

Steve

==========
Steve Waring
[hidden email]
http://www.dolphinharbor.org/dh/harbor/steve.html


Reply | Threaded
Open this post in threaded view
|

Re: Versioning a ToGo app (was: Deployed app DNU)

Don Rylander-3
Louis and Steve,
[snip]
>  - In "Step 7" of the Lagoon Deployment Wizard, I use the "Custom Options"
> to get up an inspector on the ImageStripper, and evaluate
"MySessionManager
> updateVersionResource: self versionResource".

In the Package Browser, you can also right click on the package you're
deploying and edit those strings directly in the ImageStripper there.  IIRC,
that information is then saved with the package.

Don


Reply | Threaded
Open this post in threaded view
|

Re: Versioning a ToGo app (was: Deployed app DNU)

Louis Sumberg-2
In reply to this post by Steve Waring-2
Steve, you are indeed Mr. Wizard *s*

> I have been able to get this to work by:
>  - Making a copy of the stub file.
>  - In my SessionManager, adding a class side utility method like <snip>

Unfortunately, there are two areas where this doesn't work for me, both of
them I believe are because I'm using Win98 - one more reason for me to
upgrade to WinXP.  I'm pretty sure I've verified that Win98 is the source of
the problem, e.g., I did uninstall and reinstall Dolphin to ensure I don't
have any corrupt files.

The first problem is in extracting the resources from the stub file to a
VersionResource instance.  For example, the following doesn't work and
generates an error, "An attempt was made to load a program with an incorrect
format."

    VersionResource forPath: 'C:\Program Files\Object Arts\Dolphin Smalltalk
5.0\GUIToGo.exe'.

Strangely enough (to me, at least), if I replace GUIToGo.exe with
Dolphin.exe, then it works and at least I have a valid VersionResource
instance to modify.

The second problem is that I'm unable to actually update the resources in
the exe file from Dolphin.  For example, evaluating the following from an
inspector on the package, with the ImageStripper aspect selected, results in
an error, "This function is only valid in Win32 mode."

    versionResource updateFile: executableName

BTW, I get the same error message when I try to cheat at deployment time, by
changing ImageStripper>>isResourceUpdatingPossible to answer true.

The bottom line seems to be that for now I can use ResHacker to change the
resources in the deployed exe file.  When I upgrade to WinXP, I'll use what
you presented.  Either way, I hope that in some next version of Dolphin,
there'll be an easier way to update resources, especially version info.  I
suppose I've been spoiled by the VB IDE which has made this easy for a long
time.

Thanks again.

-- Louis


Reply | Threaded
Open this post in threaded view
|

Re: Versioning a ToGo app (was: Deployed app DNU)

Blair McGlashan
In reply to this post by Steve Waring-2
"Steve Waring" <[hidden email]> wrote in message
news:mNZ99.16085$[hidden email]...
> Hi Louis,
>
> "Louis Sumberg" <[hidden email]> wrote in message
> news:3d682809$1@tobjects....
> > I've looked at VersionResource and VersionInfo and ImageStripper to see
if
> I
> > can insert (package) version info into a ToGo app, but to no avail.  It
> > appears that a deployed app will always have a version string of
'1,0,0,1'
> > (picked up from the stubfile) and that, depending on how the app wants
to
> > show the version, it'll show as either '1,0,0,1' or the Dolphin
> development
> > version (e.g., as in Notepad.exe).
>
> I have been able to get this to work by:
- Making a copy of the stub file.
>  [... snip...]
>
>  - In "Step 7" of the Lagoon Deployment Wizard, I use the "Custom Options"
> to get up an inspector on the ImageStripper, and evaluate
"MySessionManager
> updateVersionResource: self versionResource".

One can avoid the necessity of copying the stub (although you might want to
do that anyway to edit its resources) and the manual update step, by
subclassing ImageStripper and overriding the #versionResource method, for
example:

versionResource
        | verString |
        verString := MyApp versionString.
        ^(super versionResource)
                productVersion: verString;
                fileVersion: verString;
                yourself

Regards

Blair