PDA

View Full Version : Files in Use



NewsArchive
12-20-2012, 01:40 AM
Sometimes when I run an installation to upgrade a system, a target
file is in use. When the installation ends, it asks to restart the
machine, so that it can get exclusive rights to that file.

However, I can't always run the install on the server, in which case
the reboot trick won't work.

When I encounter this problem, I install it to a separate directory,
then copy the files in with Windows Explorer. It complains about the
specific files with access problems. This is a hassle. <g>

Is it possible to see a list of files that caused conflicts, so that I
can get a better idea of who's got what open? Then I can find them
and kick them out, so that I can rerun the install.

Mike Hanson
www.boxsoft.net

NewsArchive
12-20-2012, 01:41 AM
HTH..

Jane Fleming

NewsArchive
12-21-2012, 04:22 AM
Thanks, Jane. That should do the trick.

What would be better is an option to have it warn which files are in
use before proceeding with the installation, with an option to print
and/or abort. <g>

Mike Hanson
www.boxsoft.net

NewsArchive
12-21-2012, 04:22 AM
Mike,

> Thanks, Jane. That should do the trick.
>
> What would be better is an option to have it warn which files are
> in use before proceeding with the installation, with an option to
> print and/or abort. <g>

And why don't you make use of this option <g>.

See "Check In-use Folder Tree..." function. The variable %_SB_RETURNEX%
returns a list of filename(s) in use. You can then display this in a list
box.

But it's still possible that "something" locks files after this check. For
example, a anti-spyware or anti-virus product. Then Windows will again
queue the file for "replace at reboot".

And it's not a trivial task to check for in-use files before the real
installation when you have a complex deployment strategy with lots of
If..Then..Else Statements because you have to "mirror" this installation
logic into your in-use check strategy. A nearly impossible mission.

Friedrich

NewsArchive
12-21-2012, 04:23 AM
Thank-you, Friedrich. I realize that it would be impossible to cover
all contigencies, and I really appreciate what I've got.

Mike Hanson
www.boxsoft.net

NewsArchive
12-21-2012, 04:23 AM
Ok, I'm using that function after selecting the destination directory.
If it returns 1, then I display %_SB_RETURNEX% in a message box with
OK+Cancel. That's probably sufficient.

BTW, I'm seeing the pipe symbol instead of line breaks in the message
box. Is there an option to change that behavior?

Mike Hanson
www.boxsoft.net

NewsArchive
12-21-2012, 04:24 AM
Mike,

> Ok, I'm using that function after selecting the destination directory.
> If it returns 1, then I display %_SB_RETURNEX% in a message box with
> OK+Cancel. That's probably sufficient.
>
> BTW, I'm seeing the pipe symbol instead of line breaks in the message
> box. Is there an option to change that behavior?

This is the expected behavior. It returns a "List" that can be 1.) directly
displayed in a List Box Dialog (or list control in a Custom Dialog) -or- 2.)
processed via the "Handle String Operation: List Item".

And what you can do is to convert the pipe symbol to another character.

For example:

! Test List
Set Variable %LISTITEM% to "|1|2|3|4"
! Convert | to ;
Set Variable %LISTITEM% to FUNCTION:Replace(%LISTITEM%, |, ;)

Does this help?

Friedrich

NewsArchive
12-21-2012, 12:47 PM
Every time I have to add dialog boxes, I feel a bit of trepidation. I
do it so seldom, that I forget many of the idiosynchracies from one
time to the next. <g>

In this case, after the select the destination folder, I prepare a
series of display variables for the upcoming "Ready to Install"
window, then issue the Refresh Next Dialog so that it's ready.
However, now I'm injecting another dialog with a list of files. I'm
hiding or unhiding that, depending on whethere there are files in use,
so I can't be sure it will display. Is there an optimal place to
position "Refresh Next Dialog", or should I just liberally sprinkle it
here and there?

Or is there a "Refresh all upcoming dialogs" or equivalent?

BTW, I'll never make sense of when/why you use $, #, %, etc. I'm just
glad that I've got a few scripts created already, so that can just
copy what I've done before. <g>

Mike Hanson
www.boxsoft.net

NewsArchive
12-21-2012, 12:48 PM
After fiddling for a bit, I've found a combination that seems to work.
Thanks!

Mike Hanson
www.boxsoft.net

NewsArchive
12-21-2012, 12:48 PM
> After fiddling for a bit, I've found a combination that seems to work.
> Thanks!

Cool :-)

Friedrich

NewsArchive
12-21-2012, 12:49 PM
> BTW, I'll never make sense of when/why you use $, #, %, etc. I'm
> just glad that I've got a few scripts created already, so that can
> just copy what I've done before. <g>

<G>

-$ is a $CONSTANT$ (e.g. #const $TRUE$ = "1")

-# is used for text resources (e.g. #DLG_WELCOME_HEADING# resolves to
'Welcome to the [PRODUCTNAME] Setup Wizard.' at compile time).

-% is a %RUNTIME% variable.

-[] is a [COMPILERVARIABLE].

Friedrich

NewsArchive
12-21-2012, 12:49 PM
Friedrich,

> -$ is a $CONSTANT$ (e.g. #const $TRUE$ = "1")
>
> -# is used for text resources (e.g. #DLG_WELCOME_HEADING# resolves to
> 'Welcome to the [PRODUCTNAME] Setup Wizard.' at compile time).
>
> -% is a %RUNTIME% variable.
>
> -[] is a [COMPILERVARIABLE].

All fine - as long as you stay away from the dreaded curly braces!<g>

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://CreativeReporting.com

Product Release & Update Notices
http://twitter.com/DeveloperPLUS

Windows 8 brings us "The Oval, Bumper Car, Roller Coaster of Wait!"

NewsArchive
12-21-2012, 12:50 PM
>
> All fine - as long as you stay away from the dreaded curly braces!<g>
>

<G> ;-)

Friedrich

NewsArchive
12-21-2012, 12:50 PM
He was my favorite Stooge.

>
> All fine - as long as you stay away from the dreaded curly braces!<g>
>

--

Russ Eggen
RADFusion International, LLC

NewsArchive
12-22-2012, 03:10 AM
It gets more confusing, because sometimes I use a bare label/value,
while in others it requires the addition of those characters. For
example, a dialog name is specified as raw text, but when I use it in
a condition it requires that I wrap it with $, iirc.

Mike Hanson
www.boxsoft.net

NewsArchive
12-22-2012, 05:34 AM
> It gets more confusing, because sometimes I use a bare label/value,
> while in others it requires the addition of those characters. For
> example, a dialog name is specified as raw text, but when I use it in
> a condition it requires that I wrap it with $, iirc.

Yes.

If you are using a "Dialog Label" then the compiler converts this label to a
constant.

---
Dialog Label

[in] This names the specific Dialog in the script source code and creates a
constant. A constant is similar to a variable in the sense that it
represents a memory location. Wherever the constant appears in your script,
the preprocessor replaces it by its value. So, for instance, every
"$WELCOMEDIALOG$" in your source code will be replace by 1. The compiler
will only see the value 1 in your code, not "$WELCOMEDIALOG$". A constant in
your script begins and ends with the dollar sign ($).
---

Friedrich

NewsArchive
12-22-2012, 11:25 AM
Mike,

You might also review these sections in the "Learning SetupBuilder Part I"
help file:

- "Names - Variables, Constants, Etc."
- "Dialog By Name"

Jane

NewsArchive
12-23-2012, 04:33 AM
Thanks, Jane. The key problem for me is frequency of use. Although I
run SetupBuilder scripts almost delay, I tend to write them only once
or twice a year. I tend to forget... :(

Mike Hanson
www.boxsoft.net

NewsArchive
12-23-2012, 04:34 AM
You and me both, Mike!

Which is why it's nice to have a reminder somewhere...

Jane

NewsArchive
12-23-2012, 04:34 AM
I also have trouble with typos:

delay <> daily

Mike Hanson
www.boxsoft.net