Bug 691302 - Building the installer on Windows fails if UAC is enabled
Summary: Building the installer on Windows fails if UAC is enabled
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Config/Install (show other bugs)
Version: 8.70
Hardware: PC Windows 7
: P4 normal
Assignee: Hin-Tak Leung
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 05:18 UTC by Trejkaz (pen name)
Modified: 2010-06-17 19:42 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trejkaz (pen name) 2010-05-14 05:18:14 UTC
Some time in the past 3 weeks, our automated builds of Ghostscript stopped working with this mysterious error:

     [exec] 	make_filelist.exe -title "GPL Ghostscript 8.70" -dir "gs8.70" -list "filelist.txt" @gs8.70\obj\dwfiles.rsp
     [exec] NMAKE : fatal error U1045: spawn failed : No error
     [exec] Stop.

On investigating, it turned out that the executable had the shield icon, requiring admin access to run, and when running as an automated process, it failed to get this access, thus causing the build failure.

If the build is run as the admin user, the build passes, but it shouldn't need to be admin just to *build* the installer.
Comment 1 Hin-Tak Leung 2010-05-19 15:22:36 UTC
(In reply to comment #0)
> Some time in the past 3 weeks, our automated builds of Ghostscript stopped
> working with this mysterious error:
> 
>      [exec]     make_filelist.exe -title "GPL Ghostscript 8.70" -dir "gs8.70"
> -list "filelist.txt" @gs8.70\obj\dwfiles.rsp
>      [exec] NMAKE : fatal error U1045: spawn failed : No error
>      [exec] Stop.
> 
> On investigating, it turned out that the executable had the shield icon,
> requiring admin access to run, and when running as an automated process, it
> failed to get this access, thus causing the build failure.
> 
> If the build is run as the admin user, the build passes, but it shouldn't need
> to be admin just to *build* the installer.

Yes and no. In general, it doesn't need to be admin to build the installer of some other software, but in this case, make_filelist.exe is a copy of setupgs.exe (the installer program) and its behaviour is different depending on the number of arguments. So setupgs.exe needs the shield icon for install, therefore make_filelist.exe gains it by being just a copy.

It is going to be some non-trivial effort for separating the two.
Comment 2 Henry Stiles 2010-05-20 16:53:30 UTC
Sounds like this should be closed as wontfix.
Comment 3 Hin-Tak Leung 2010-05-20 22:59:53 UTC
I am inclined to close this as WONTFIX, since the design has been this way for years and nobody has complained; and requiring admin privildge to build the installer is reasonable; also that nobody outside should be building and distributing an installer, so we won't support non-ghostscript/artifex personnel in that direction.

That said, I'll give you an outline of what needs to be done: the code one needs to extract is psi/dwsetup.cpp around line 471 and the entire make_filelist() starting in line 1087; you need to extract that part and make it stand-alone, and modify psi/winint.mak where it copy setupgs.exe to make_filelist.exe to build a it standaline; and also duplicate enough of other files to make it build standalone.

If your own development resource can supply a patch in the direction outlined above, we'll review it. Otherwise, it is WONTFIX.
Comment 4 Hin-Tak Leung 2010-06-08 23:44:25 UTC
There is a new way of building an installer based on NSIS - 
http://bugs.ghostscript.com/show_bug.cgi?id=691363#c3

It shouldn't require admin privilege to run. Let me know if that does what you want. OTOH, I probably know enough about the older winzipse-based installer well enough to fix this bug as I outlined in comment 1 without spending too much time on it.
Comment 5 Hin-Tak Leung 2010-06-17 19:42:51 UTC
I have done the work myself as I outlined in comment 3 - splitting the functionality of make_filelist out of setupgs, and other necessary plumbing - in r11388. It should work as it did with MS tools, and no longer requires admin privilege to build the installer.

While looking at this, I found that borland-tool windows build has been broken for a long time for many issues accumulated over time. Will be filing a separate bug for that.