{"id":2503,"date":"2006-01-26T15:28:00","date_gmt":"2006-01-26T15:28:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/heaths\/2006\/01\/26\/setup-exe-bootstrap-sample-and-appver\/"},"modified":"2006-01-26T15:28:00","modified_gmt":"2006-01-26T15:28:00","slug":"setup-exe-bootstrap-sample-and-appver","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/setup\/setup-exe-bootstrap-sample-and-appver\/","title":{"rendered":"Setup.exe Bootstrap Sample and APPVER"},"content":{"rendered":"<p>On an internal alias &#8211; which inspires many of my blog entries &#8211; someone\nwasn&#8217;t able to run the sample bootstrap executable <i>setup.exe<\/i>, found in\nthe <i>Samples\/SysMgmt\/Msi\/Setup.exe<\/i> folder in your\n<a href=\"http:\/\/msdn.microsoft.com\/platformsdk\/\">Platform SDK<\/a> installation\nroot. The error was &quot;setup.exe is not a valid Win32 application&quot; when run on\nWindows 2000 but the sample worked fine on Windows XP. Right away it would seem\nthat something in the\n<a href=\"http:\/\/msdn.microsoft.com\/msdnmag\/issues\/02\/02\/PE\/default.aspx\">\nPE headers<\/a> of the sample something is wrong. Take a look at part of the <i>\ndumpbin.exe<\/i> output:<\/p>\n<pre>OPTIONAL&nbsp;HEADER&nbsp;VALUES\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10B&nbsp;magic&nbsp;#&nbsp;(PE32)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7.10&nbsp;linker&nbsp;version\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A800&nbsp;size&nbsp;of&nbsp;code\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6200&nbsp;size&nbsp;of&nbsp;initialized&nbsp;data\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;size&nbsp;of&nbsp;uninitialized&nbsp;data\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5566&nbsp;entry&nbsp;point&nbsp;(00405566)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1000&nbsp;base&nbsp;of&nbsp;code\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C000&nbsp;base&nbsp;of&nbsp;data\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;400000&nbsp;image&nbsp;base&nbsp;(00400000&nbsp;to&nbsp;00414FFF)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1000&nbsp;section&nbsp;alignment\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;200&nbsp;file&nbsp;alignment\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.00&nbsp;operating&nbsp;system&nbsp;version\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;image&nbsp;version\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"#FF0000\">5.01&nbsp;subsystem&nbsp;version<\/font>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;Win32&nbsp;version\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;15000&nbsp;size&nbsp;of&nbsp;image\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;400&nbsp;size&nbsp;of&nbsp;headers\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1EF48&nbsp;checksum\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;subsystem&nbsp;(Windows&nbsp;GUI)<\/pre>\n<p>Because the subsystem version is 5.01 the executable will run on a minimum\noperating system of Windows XP. So how did this happen?<\/p>\n<p>If you build the <i>setup.exe<\/i> sample using the build environment consoles\nalso installed with the Platform SDK, the environment variable <code>APPVER<\/code> is set\naccording to which OS you pick in the current options. If you started the\nshortcut &quot;Set Windows XP 32-bit Build Environment (Retail)&quot; then <code>APPVER<\/code> is\ndefined as 5.01. This variable is used many places in the <i>win32.mak<\/i> file\nincluded by <i>Makefile<\/i> in the <i>setup.exe<\/i> sample directory.\nParticularilily this is why the subsystem was set to 5.01:<\/p>\n<p style=\"font-family: courier new, monospace\"># Windows 98 needs subsystem\nversion set to 4.10 for version 5.0 features.<br \/>\n!IF (&quot;$(APPVER)&quot; == &quot;5.0&quot;) &amp;&amp; ((&quot;$(TARGETOS)&quot; == &quot;BOTH&quot;) || (&quot;$(TARGETOS)&quot; ==\n&quot;WIN95&quot;))<br \/>\nEXEVER = 4.10<br \/>\n!ELSE<br \/>\nEXEVER = $(APPVER)<br \/>\n!ENDIF<\/p>\n<p>\n# &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p># for Windows applications<br \/>\nconlflags = $(lflags) -subsystem:console,$(EXEVER)<br \/>\nguilflags = $(lflags) -subsystem:windows,$(EXEVER)<\/p>\n<p>So when building <i>setup.exe<\/i> make sure you set <code>APPVER<\/code> according to your\nplatform requirements. You can either start the appropriate build environment\nconsole or after starting the console set <code>APPVER<\/code> to 4.0, 5.0, 5.01,\nor 5.02. Future versions of the Platform SDK for future versions of Windows will\nlikely include support for additional values.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On an internal alias &#8211; which inspires many of my blog entries &#8211; someone wasn&#8217;t able to run the sample bootstrap executable setup.exe, found in the Samples\/SysMgmt\/Msi\/Setup.exe folder in your Platform SDK installation root. The error was &quot;setup.exe is not a valid Win32 application&quot; when run on Windows 2000 but the sample worked fine on [&hellip;]<\/p>\n","protected":false},"author":389,"featured_media":3843,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[14,20],"class_list":["post-2503","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-development","tag-installation"],"acf":[],"blog_post_summary":"<p>On an internal alias &#8211; which inspires many of my blog entries &#8211; someone wasn&#8217;t able to run the sample bootstrap executable setup.exe, found in the Samples\/SysMgmt\/Msi\/Setup.exe folder in your Platform SDK installation root. The error was &quot;setup.exe is not a valid Win32 application&quot; when run on Windows 2000 but the sample worked fine on [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/2503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/users\/389"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/comments?post=2503"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/2503\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media\/3843"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media?parent=2503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/categories?post=2503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/tags?post=2503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}