Re: Windows: Modifying app_faker.c to handle .manifests and private dlls

"Thomas Convard" <[email protected]> Sat, 26 Apr 2008 09:45:30 +0200
Newsgroups gmane.comp.graphics.chromium.user
Message-ID <[email protected]>
--===============2120644213==
Content-Type: multipart/alternative; 
	boundary="----=_Part_4007_6577485.1209195930132"

------=_Part_4007_6577485.1209195930132
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Our practice is to copy the crfaker.dll into the application directory and
rename it to opengl32.dll. Thus we didn't had to modify our application.
I am not sure it is a clean way but it works fine!

Regards,
Thomas


2008/4/25, David L. Page <[email protected]>:
>
> Yes, I believe this snippet might be what you are refering to. The
> documentation has the following note:
>
> *Windows*: You will also need to install the cygwin tools<http://cygwin.com/>to build Chromium. If you're building from the Windows shell (as opposed to
> the cygwin bash implementation), you will need to set the environment
> variable MAKE_MODE to the string "unix". This lets gmake use bash as its
> subshell instead of the Windows shell, which is required. Shared libraries
> on Windows get put in cr-X.Y/bin/WIN_NT, which (since it's on your path,
> right?) will be searched automatically, so there's no LD_LIBRARY_PATHsilliness.
>
> However, if I load an app.exe with crappfaker.exe and the dir where the
> app.exe is located is not in my path, then the dlls are not found. More
> specifically, the app.exe.manifest file is not properly located. It's my
> understanding (I maybe wrong) that app.exe.manifest needs to be in the same
> directory where app.exe is spawned. The kludge that I have put together in
> app_faker.c moves not only app.exe to the tmp directory but additionally
> moves app.exe.manifest. This solution seems to do the trick.
>
> Is it a bad idea to copy not only app.exe but also app.exe.manifest (and
> perhaps private dlls) to the tmp directory
>
> --Dave
>
>
>
>
> On Fri, Apr 25, 2008 at 3:59 PM, Greg Humphreys <[email protected]> wrote:
>
>>  You can specify that the app faker start in another directory, so the
>> app can find private dlls, data files,  and the like.
>>
>> I done remember the exact command, but surely it is documented :)
>>
>> -- Greg
>>
>> On Apr 25, 2008, at 3:49 PM, "David L. Page" <[email protected]> wrote:
>>
>>
>> I'm not really a developer, but this post should probably go there.
>>
>> In regards to a previous post, I noted that Windows manifest files were
>> causing problems on my system for executing the OpenGL demos, specially
>> atlantis.exe.
>>
>> I previously posted a kludge to embed the manifests in the exe files, but
>> this approach would seem to go against the Chromium philosophy of not
>> requiring mods to an existing OpenGL app.
>>
>> So, I dug into it a bit more and the problem seems to occur from the fact
>> that crappfaker.exe copies atlantis.exe (for example) to a temporary
>> directory and then copies crfaker.dll to that same tmp directory with the
>> name opengl32.dll. In this manner, atlantis.exe (or whatever app) is fooled
>> into thinking that crfaker.dll is the OpenGL library.
>>
>> BUT! The big problem here is that that file atlantis.exe.manifest doesn't
>> get copied by crappfaker.exe, and thus Windows is unable to load the
>> msvcr80d.dll.
>>
>> I am speculating, but I think this particular behavior would also cause
>> problems for private dlls as well where a private dll is one that is located
>> in the directory where an app exe is located AND that directory is not in
>> the load path of Windows. So, a private dll would also not be copied to the
>> tmp directory and thus would not be linked. A similar issue would seem to
>> arise with .local files (i.e. app.exe.local). I don't have a good
>> understanding of these, but I think they also would need to be copied to the
>> tmp directory.
>>
>> That's what I've figured out so far. I have a modified version of
>> app_faker.c working on my system. This mod avoids the need for mt.exe
>> embedding of manifests into an app exe, i.e. no need to modify an OpenGL
>> app.
>>
>> My coding practice is very much a hack job. Is there a developer out there
>> that might have an interest is cleaning my mess up and including it in the
>> development of Chromium?
>>
>> --Dave
>>
>>
>> --
>> David L. Page, PhD
>> <[email protected]>[email protected]
>> 865.607.8192
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>> Don't miss this year's exciting event. There's still time to save $100.
>> Use priority code J8TL2D2.
>>
>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>>
>>  _______________________________________________
>> Chromium-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/chromium-users
>>
>>
>
>
> --
> David L. Page, PhD
> [email protected]
> 865.607.8192
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
>
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Chromium-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/chromium-users
>
>

------=_Part_4007_6577485.1209195930132
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Our practice is to copy the crfaker.dll into the application directory
and rename it to opengl32.dll. Thus we didn&#39;t had to modify our
application.<br>
I am not sure it is a clean way but it works fine!<br>
<br>
Regards,<br>
Thomas<br>
<br>
<br><div><span class="gmail_quote">2008/4/25, David L. Page &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Yes, I believe this snippet might be what you are refering to. The documentation has the following note:</div>
<div>&nbsp;</div>
<div><strong>Windows</strong>: You will also need to install the <a href="http://cygwin.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">cygwin tools</a>
to build Chromium. If you&#39;re building from the Windows shell (as
opposed to the cygwin bash implementation), you will need to set the
environment variable <span>MAKE_MODE</span> to the string &quot;<code>unix</code>&quot;. This lets <span>gmake</span> use <span>bash</span> as its subshell instead of the Windows shell, which is required. Shared libraries on Windows get put in <span>cr-X.Y/bin/WIN_NT</span>, which (since it&#39;s on your path, right?) will be searched automatically, so there&#39;s no <span>LD_LIBRARY_PATH</span> silliness. </div>


<div>&nbsp;</div>
<div>However, if I load an app.exe with crappfaker.exe and the&nbsp;dir
where the app.exe is located is not in my path, then the dlls are not
found. More specifically, the app.exe.manifest file is not properly
located. It&#39;s my understanding (I maybe wrong) that app.exe.manifest
needs to be in the same directory where app.exe is spawned. The kludge
that I have put together in app_faker.c moves not only app.exe to the
tmp directory but additionally moves app.exe.manifest. This solution
seems to do the trick.</div>

<div>&nbsp;</div>
<div>Is it a bad idea to copy not only app.exe but also app.exe.manifest (and perhaps private dlls) to the tmp directory</div>
<div>&nbsp;</div>
<div>--Dave</div>
<div>&nbsp;</div>
<div><br><br>&nbsp;</div>
<div class="gmail_quote">On Fri, Apr 25, 2008 at 3:59 PM, Greg Humphreys &lt;<a href="mailto:[email protected]" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">[email protected]</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div bgcolor="#FFFFFF">
<div>You can specify that the app faker start in another directory, so
the app can find private dlls, data files,&nbsp; and the like.&nbsp;</div>
<div><br></div>
<div>I done remember the exact command, but surely it is documented :)<br><br>-- 
<div>Greg&nbsp;</div></div><div><span class="e" id="q_119873b1d3499533_1">
<div>
<div></div>
<div>
<div><br>On Apr 25, 2008, at 3:49 PM, &quot;David L. Page&quot; &lt;<a href="mailto:[email protected]" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">[email protected]</a>&gt; wrote:<br><br></div>
<div></div>
<blockquote type="cite">
<div>
<div>&nbsp;</div>
<div>I&#39;m not really a developer, but this post should probably go there. </div>
<div>&nbsp;</div>
<div>In regards to a previous post, I noted that Windows manifest files
were causing problems on my system for executing the OpenGL demos,
specially atlantis.exe. </div>
<div>&nbsp;</div>
<div>I previously posted a kludge to embed the manifests in the exe
files, but this approach would seem to go against the Chromium
philosophy of not requiring mods to an existing OpenGL app.</div>
<div>&nbsp;</div>
<div>So, I dug into it a bit more and the problem seems to occur from
the fact that crappfaker.exe copies atlantis.exe (for example) to a
temporary directory and then copies <span>crfaker.dll</span> to that
same tmp directory with the name opengl32.dll. In this manner,
atlantis.exe (or whatever app) is fooled into thinking that crfaker.dll
is the OpenGL library.</div>

<div>&nbsp;</div>
<div>BUT! The big problem here is that that file atlantis.exe.manifest
doesn&#39;t get copied by crappfaker.exe, and thus Windows is unable to
load the msvcr80d.dll.</div>
<div>&nbsp;</div>
<div>I am speculating, but I think this particular behavior would also
cause problems for private dlls as well where a private dll is one that
is located in the directory where an app exe is located AND that
directory is not in the load path of Windows. So, a private dll would
also not be copied to the tmp directory and thus would not be linked. A
similar issue would seem to arise with .local files (i.e.
app.exe.local). I don&#39;t have a good understanding of these, but I think
they also would need to be copied to the tmp directory.</div>

<div>&nbsp;</div>
<div>That&#39;s what I&#39;ve figured out so far. I have a modified version of
app_faker.c working on my system. This&nbsp;mod avoids the need for
mt.exe embedding of manifests into an app exe, i.e. no need to modify
an OpenGL app.&nbsp;</div>

<div>&nbsp;</div>
<div>My coding practice is very much a hack job. Is there a developer
out there that might have an interest is cleaning my mess up and
including it in the development of Chromium?</div>
<div>&nbsp;</div>
<div>--Dave</div>
<div><br clear="all"><br>-- <br>David L. Page, PhD<br><a href="mailto:[email protected]" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"></a><a href="mailto:[email protected]" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">[email protected]</a><br>
865.607.8192<br></div></div></blockquote>
</div></div>
</span></div><blockquote type="cite">
<div><span>-------------------------------------------------------------------------</span><br><span>This SF.net email is sponsored by the 2008 JavaOne(SM) Conference </span><br><span>Don&#39;t miss this year&#39;s exciting event. There&#39;s still time to save $100. </span><br>

<span>Use priority code J8TL2D2. </span><br><span><a href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</a></span></div>

</blockquote>
<blockquote type="cite">
<div><span>_______________________________________________</span><br><span>Chromium-users mailing list</span><br><span><a href="mailto:[email protected]" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">[email protected]</a></span><br>

<span><a href="https://lists.sourceforge.net/lists/listinfo/chromium-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.sourceforge.net/lists/listinfo/chromium-users</a></span><br>
</div></blockquote></div></blockquote></div><div><span class="e" id="q_119873b1d3499533_3"><br><br clear="all">
<br>-- <br>David L. Page, PhD<br><a href="mailto:[email protected]" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">[email protected]</a><br>865.607.8192<br>
</span></div><br>-------------------------------------------------------------------------<br>
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<br>
Don&#39;t miss this year&#39;s exciting event. There&#39;s still time to save $100.<br>
Use priority code J8TL2D2.<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone" target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</a><br>
_______________________________________________<br>
Chromium-users mailing list<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:[email protected]">[email protected]</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/chromium-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/chromium-users</a><br>
<br></blockquote></div><br>

------=_Part_4007_6577485.1209195930132--


--===============2120644213==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
--===============2120644213==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Chromium-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chromium-users

--===============2120644213==--