Bug 315746 (MONO62859) - Hardcoded paths in Windows gtk# installer
Summary: Hardcoded paths in Windows gtk# installer
Status: RESOLVED MOVED
Alias: MONO62859
Product: Mono: Runtime
Classification: Mono
Component: packaging (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Critical
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-11 16:14 UTC by Marcelo Rezende Módolo
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
package that contains the batch files and shell scripts with the correct path (12.44 KB, application/octet-stream)
2004-09-20 22:54 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:49:43 UTC


---- Reported by mrmodolo@terra.com.br 2004-08-11 09:14:25 MST ----

Hi,
I am very happy with mono, I was using mono 1.0 and now I download the 
bug fix version (mono-1.0.1-gtksharp-1.0-win32-0.5.exe) this new 
instalation is very complete, I like the xsp included and SQL# GTK but 
when I try to run all the gtk things I received a lot of erros about 
files and dlls not found in c:\mono\mono-1.0 so I uninstall and reinstall 
in c:\mono\mono-1.0 (I try c:\mono\mono-1.0.1 but do not work)  after 
that every think work. So I think that the paths was hard coded in the 
gtk engine.

thanks,
marcelo modolo



---- Additional Comments From martin@wrasse.demon.co.uk 2004-09-15 10:38:15 MST ----

Isn't this on the wrong product?

Should bt on the mono runtime, since its a problem with the runtime
installer on win32.




---- Additional Comments From tberman@off.net 2004-09-19 01:20:41 MST ----

moving this bug



---- Additional Comments From martinf@mfconsulting.com 2004-09-20 15:54:56 MST ----

Created an attachment (id=166619)
package that contains the batch files and shell scripts with the correct path




---- Additional Comments From martinf@mfconsulting.com 2004-09-20 16:07:40 MST ----

Indeed there are hard coded path in the contents of every batch file
and shell script file in the source directory that will end up in
{app}\bin.

This is by design.  In the final phases of the installation routine,
the  installer will go through a list of files and will replace all
coccurances of C:\mono\Mono-1.0 for what ever would be the appropriate
base path that was selected as the destination directory by the user.
 Conversly all references of C:/mono/Mono-1.0 are also changed.  This
is done in pkg-config files *.pc and through out selected files in
/etc and elsewhere.

Although the function is much larger I will try to paste a section to
ilustrate what I mean (this is Pascal Script):

Procedure WriteRootPath(const cstrBasePath, cstrBasePathForwardSlash:
String);
var strFilePath, strPortXSP: String;
begin
  // Shell Scripts
	strFilePath := RemoveBackslash(cstrBasePath) + '\bin\cert2spc.'
	ReplaceRootPath(strFilePath, 'C:\mono\Mono-1.0', 'C:/mono/Mono-1.0',
cstrBasePath, cstrBasePathForwardSlash);
	// etc files
	strFilePath := RemoveBackslash(cstrBasePath) +
'\etc\gtk-2.0\gdk-pixbuf.loaders.'
	ReplaceRootPath(strFilePath, 'C:\mono\Mono-1.0', 'C:/mono/Mono-1.0',
cstrBasePath, cstrBasePathForwardSlash);
    // Pkg-config files
	strFilePath := RemoveBackslash(cstrBasePath) + '\lib\pkgconfig\atk.pc';
	ReplaceRootPath(strFilePath, 'C:\mono\Mono-1.0', 'C:/mono/Mono-1.0',
cstrBasePath, cstrBasePathForwardSlash);
	// Batch Files
	strFilePath := RemoveBackslash(cstrBasePath) + '\bin\cert2spc.bat'
	ReplaceRootPathForBat(strFilePath, 'C:\mono\Mono-1.0', cstrBasePath);
    // Set the Port for XSP
    strPortXSP := PortForXSP.Values[0];
	ReplaceRootPathForBat(strFilePath, '8089', strPortXSP);
	strFilePath := RemoveBackslash(cstrBasePath) + '\bin\wsdl.bat'
	ReplaceRootPathForBat(strFilePath, 'C:\mono\Mono-1.0', cstrBasePath);
	strFilePath := RemoveBackslash(cstrBasePath) + '\bin\xsd.bat'
	ReplaceRootPathForBat(strFilePath, 'C:\mono\Mono-1.0', cstrBasePath);
end;




---- Additional Comments From stm3@qwest.net 2004-09-24 16:38:56 MST ----

Yikes.  I ran into this problem as well and was going to report this 
bug.  May I suggest a MUCH more standard, reliable and easy way of 
doing this?

Have the installer create an environment variable called MONOPATH.  
Set it to the install path.  The installer you're using can do this 
easily in one line, although it's important to mention that this 
environment variable is only set for applications started AFTER it's 
set, meaning the installer itself doesn't have access to it!

Your batch files then need to look like this:
@echo off
call %MONOPATH%\bin\setmonopath.bat
cd /D %MONOPATH%\share\doc\xsp\test"
mono %MONOPATH%\bin\xsp.exe --root . --port 8088 --applications /:.

This will work on all win32 OS's.

I'd recommend removing these batch files until they work with a 
default install OR very clearly marking the INSTALLER as BETA or 
doing an echo in the batch files explaining...  Installing non-
functioning icons with no explanation in a default install is a 
*critical* bug by Windows standards.  Linux users more realistically 
consider it cosmetic, but it is a windows installer...

Also, this utility may be very useful to you for your install:

http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/se
tx-o.asp




---- Additional Comments From martinf@mfconsulting.com 2004-10-04 06:04:47 MST ----

The path replacement function has been used successfully in thousands
of downloads of the installer revisions I have hosted at Novell Forge.  

I am familiar with Setx.exe and Inno Setup has the same capabilities
built-in.

*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO66644 ***

Imported an attachment (id=166619)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>XP Home Edition Versão 2002 SP1</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".
This bug was marked DUPLICATE in the database it was moved from.
    Changing resolution to "MOVED"