PDA

View Full Version : File association



NewsArchive
05-27-2008, 01:41 AM
Hi Friedrich,

I think I've found a bug in the file association creation. In the
Build Automator I can take various command line parameters and for
example I can use /O= for OPEN and /E= for EXECUTE. I associated
".aprj" but when SB creates the shortcut it put:

"C:\program files\...\buildautomator.exe" /O= "%1%"

That space between the /O= and the parameter causes the Command('/O')
to fail in Clarion and is according to the documentation.

Now I'm not sure if this is a problem in how SB creates this or if
this is how the OS does this. If I remove the space I can detect the
/O flag with Command('/O') and the Build Automator opens the file.

Yep, it writes /O= "%1" to the registry.

So I worked around this by writing the key entry after it's created by
the File Associate and put it in as:

"%SB_INSTALLDIR%\buildautomator.exe" /O="%1"

and it works perfectly now:)

I could change it so that if no flag is specified it automatically
uses the open, but since I have code in there that uses /O and /E etc.
I figured I might as well do it this way, not realizing there was the
extra space and that extra space sets Command() off;)

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
05-27-2008, 01:42 AM
Hi Friedrich,

>That space between the /O= and the parameter causes the Command('/O')
>to fail in Clarion and is according to the documentation.

I meant to say "according to the Clarion documentation"

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
05-27-2008, 03:17 AM
Hi Arnór,

> I think I've found a bug in the file association creation. In the
> Build Automator I can take various command line parameters and for
> example I can use /O= for OPEN and /E= for EXECUTE. I associated
> ".aprj" but when SB creates the shortcut it put:
>
> "C:\program files\...\buildautomator.exe" /O= "%1%"
>
> That space between the /O= and the parameter causes the Command('/O')
> to fail in Clarion and is according to the documentation.

Hmm, looks okay to me. See attaced screenshot. This is from the Windows
Mesia Player file association.

SetupBuilder creates the following format:

"C:\program files\...\buildautomator.exe" /O= "%1%"

Windows Media Player has:

"C:\Program Files\Windows Media Player\wmplayer.exe" /prefetch:5 /Open "%L"

IMO, the file association (format) created by the SetupBuilder installer is
correct.

What do you think?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-28-2008, 02:38 AM
Hi Friedrich,

>Hmm, looks okay to me. See attaced screenshot. This is from the Windows
>Mesia Player file association.
>
>SetupBuilder creates the following format:
>
>"C:\program files\...\buildautomator.exe" /O= "%1%"

That space is exactly the problem.

From the C6.0 help on Command():

"COMMAND searches the command line for flag=value and returns value.
There must be no blanks between flag, the equal sign, and value. The
returned value terminates at the first comma or blank space. If a
blank or comma is desired in a command line parameter, everything to
the right of the equal sign must be enclosed in double quotes
(flag="value")."

Note the "There must be no blanks between flag, the equal sing, and
the value" This means that:

/O= "myfile.aprj"

fails

/O="myfile.aprj"

works.

So when I do:

FileToOpen = Command('/O')

It returns an empty string because of the space.

I fixed this by just updating the registry key and it works fine:)

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
05-28-2008, 02:39 AM
Hi Arnór,

>>SetupBuilder creates the following format:
>>
>>"C:\program files\...\buildautomator.exe" /O= "%1%"
>
> That space is exactly the problem.

Yes, I was referring to your first message where you said "I think I've
found a bug". I wanted to point out that this is not a bug in SetupBuilder.
The blank is required.

For example:

http://msdn.microsoft.com/en-us/library/bb165967(VS.80).aspx

It should be:

"C:\VisualStudioPath\Common7\IDE\devenv.exe" /dde "%1"

and not:

"C:\VisualStudioPath\Common7\IDE\devenv.exe" /dde"%1"

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-28-2008, 02:39 AM
Hi Friedrich,

>"C:\program files\...\buildautomator.exe" /O= "%1%"

I went back and redesigned this so that there is no /O= now. It just
checks if there is parameter and then checks if it's a valid file and
off it goes. I now also have /E for /Execute that can be added to the
end in shortcuts to execute the project:)

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php