Browse Source

Fixed SD2-396: Opening a Visual Studio Solution with #D causes Error "... is not a valid solution file".

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@298 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
71081bf366
  1. BIN
      bin/setup/BuildHelpIndex.pdb
  2. 7
      bin/setup/PostInstallTasks.bat
  3. 40
      bin/setup/PostInstallTasks.vbs
  4. 4
      bin/setup/PreUninstallTasks.bat
  5. 38
      bin/setup/PreUninstallTasks.vbs
  6. 48
      setup/Corsavy.nsi
  7. 10
      setup/readme.txt
  8. 15
      src/Main/Base/Project/Src/Project/Solution/Solution.cs

BIN
bin/setup/BuildHelpIndex.pdb

Binary file not shown.

7
bin/setup/PostInstallTasks.bat

@ -10,6 +10,7 @@ echo.
echo ICSharpCode.SharpZipLib.dll echo ICSharpCode.SharpZipLib.dll
..\tools\gacutil2.exe /i ..\ICSharpCode.SharpZipLib.dll ..\tools\gacutil2.exe /i ..\ICSharpCode.SharpZipLib.dll
echo. echo.
echo Installing and configuring help system rem echo Installing and configuring help system
BuildHelpIndex.exe rem cd help
REM pause rem call register.bat
@IF %ERRORLEVEL% NEQ 0 PAUSE

40
bin/setup/PostInstallTasks.vbs

@ -1,40 +0,0 @@
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.CurrentDirectory = GetSetupPath()
WScript.Echo "Installing shared assemblies into the GAC" & vbCrLf
WScript.Echo "ICSharpCode.SharpZipLib.dll"
RegisterInGAC "..\ICSharpCode.SharpZipLib.dll"
WScript.Echo "NUnit.Core.dll"
RegisterInGAC "..\nunit.core.dll"
WScript.Echo "NUnit.Framework.dll"
RegisterInGAC "..\nunit.framework.dll"
Execute "BuildHelpIndex.exe"
' SHARED FUNCTIONS
Public Sub RegisterInGAC(strAssemblyRelativePath)
Execute "..\tools\gacutil2.exe /i:" & strAssemblyRelativePath
End Sub
Public Sub Execute(strProgram)
Dim oExec
Set oExec = WshShell.Exec(strProgram)
Do While oExec.Status = 0
WScript.Sleep 100
Loop
WScript.Echo oExec.StdOut.ReadAll
End Sub
Public Function GetSetupPath()
Dim strSetupDirPath
strSetupDirPath = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\"))
GetSetupPath = strSetupDirPath
End Function

4
bin/setup/PreUninstallTasks.bat

@ -6,4 +6,6 @@ echo.
..\tools\gacutil2.exe /u ..\nunit.framework.dll ..\tools\gacutil2.exe /u ..\nunit.framework.dll
echo. echo.
..\tools\gacutil2.exe /u ..\ICSharpCode.SharpZipLib.dll ..\tools\gacutil2.exe /u ..\ICSharpCode.SharpZipLib.dll
REM pause rem cd help
rem call unregister.bat
@IF %ERRORLEVEL% NEQ 0 PAUSE

38
bin/setup/PreUninstallTasks.vbs

@ -1,38 +0,0 @@
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.CurrentDirectory = GetSetupPath()
WScript.Echo "Removing shared assemblies from the GAC" & vbCrLf
WScript.Echo "ICSharpCode.SharpZipLib.dll"
RemoveFromGAC "..\ICSharpCode.SharpZipLib.dll"
WScript.Echo "NUnit.Core.dll"
RemoveFromGAC "..\nunit.core.dll"
WScript.Echo "NUnit.Framework.dll"
RemoveFromGAC "..\nunit.framework.dll"
' SHARED FUNCTIONS
Public Sub RemoveFromGAC(strAssemblyRelativePath)
Execute "..\tools\gacutil2.exe /u:" & strAssemblyRelativePath
End Sub
Public Sub Execute(strProgram)
Dim oExec
Set oExec = WshShell.Exec(strProgram)
Do While oExec.Status = 0
WScript.Sleep 100
Loop
WScript.Echo oExec.StdOut.ReadAll
End Sub
Public Function GetSetupPath()
Dim strSetupDirPath
strSetupDirPath = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\"))
GetSetupPath = strSetupDirPath
End Function

48
setup/Corsavy.nsi

@ -11,7 +11,7 @@
!define MUI_WELCOMEFINISHPAGE_BITMAP "wizard-image.bmp" !define MUI_WELCOMEFINISHPAGE_BITMAP "wizard-image.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "wizard-image.bmp" !define MUI_UNWELCOMEFINISHPAGE_BITMAP "wizard-image.bmp"
BrandingText "© 2000-2004 ic#code, http://www.icsharpcode.net/" BrandingText "© 2000-2005 ic#code, http://www.icsharpcode.net/"
SetCompressor lzma SetCompressor lzma
CRCCheck on CRCCheck on
@ -61,11 +61,11 @@ ShowUnInstDetails show
; .NET Framework check ; .NET Framework check
; http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/dnnetdep/html/redistdeploy1_1.asp ; http://msdn.microsoft.com/netframework/default.aspx?pull=/library/en-us/dnnetdep/html/redistdeploy1_1.asp
; Section "Detecting that the .NET Framework 1.1 is installed" ; Section "Detecting that the .NET Framework 2.0 Beta 2 is installed"
Function .onInit Function .onInit
ReadRegDWORD $R0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322" Install ReadRegDWORD $R0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50215" Install
StrCmp $R0 "" 0 CheckPreviousVersion StrCmp $R0 "" 0 CheckPreviousVersion
MessageBox MB_OK "Microsoft .NET Framework 1.1 was not found on this system.$\r$\n$\r$\nUnable to continue this installation." MessageBox MB_OK "Microsoft .NET Framework 2.0 Beta 2 was not found on this system.$\r$\n$\r$\nUnable to continue this installation."
Abort Abort
CheckPreviousVersion: CheckPreviousVersion:
@ -85,21 +85,28 @@ Function .onInit
FunctionEnd FunctionEnd
Section "MainSection" SEC01 Section "MainSection" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer SetOverwrite ifnewer
; Those files are included with the installer ; any file that would go in the root
File /r ..\AddIns SetOutPath "$INSTDIR"
File /r ..\bin
File /r ..\data
File /r ..\doc SetOutPath "$INSTDIR\AddIns"
File /r ..\AddIns\*.*
SetOutPath "$INSTDIR\bin"
File /r ..\bin\*.*
SetOutPath "$INSTDIR\data"
File /r ..\data\*.*
SetOutPath "$INSTDIR\doc"
File /r ..\doc\*.*
CreateDirectory "$SMPROGRAMS\SharpDevelop" CreateDirectory "$SMPROGRAMS\SharpDevelop"
CreateShortCut "$SMPROGRAMS\SharpDevelop\SharpDevelop.lnk" "$INSTDIR\bin\SharpDevelop.exe" CreateShortCut "$SMPROGRAMS\SharpDevelop\SharpDevelop.lnk" "$INSTDIR\bin\SharpDevelop.exe"
CreateShortCut "$DESKTOP\SharpDevelop.lnk" "$INSTDIR\bin\SharpDevelop.exe" CreateShortCut "$DESKTOP\SharpDevelop.lnk" "$INSTDIR\bin\SharpDevelop.exe"
CreateShortCut "$SMPROGRAMS\SharpDevelop\SharpDevelop Help.lnk" "$INSTDIR\doc\help\sharpdevelop.chm"
; Add default file associations ; Add default file associations
; CreateFileAssociation extension extType extDef exeCmd defIcon ; CreateFileAssociation extension extType extDef exeCmd defIcon
${CreateFileAssociation} ".cmbx" "SD.cmbxfile" "#Develop Combine" "$INSTDIR\bin\SharpDevelop.exe" "$INSTDIR\data\resources\filetypes\cmbx.ico" ${CreateFileAssociation} ".cmbx" "SD.cmbxfile" "#Develop Combine" "$INSTDIR\bin\SharpDevelop.exe" "$INSTDIR\data\resources\filetypes\cmbx.ico"
@ -122,23 +129,22 @@ Section -Post
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
; ExecShell "" "$INSTDIR\bin\tools\GacUtil2 /i ..\nunit.core.dll" "" SW_SHOWMINIMIZED
; ExecShell "" "$INSTDIR\bin\tools\GacUtil2 /i ..\nunit.framework.dll" "" SW_SHOWMINIMIZED
; now finally call our post install tasks ; now finally call our post install tasks
ExecWait '"$SYSDIR\cscript.exe" "$INSTDIR\bin\setup\PostInstallTasks.vbs"' SetOutPath "$INSTDIR\bin\setup"
; return code goes to $0 -> don't fail setup when there are Help2 problems
ExecWait '"$INSTDIR\bin\setup\PostInstallTasks.bat"' $0
SectionEnd SectionEnd
Section Uninstall Section Uninstall
Delete "$DESKTOP\SharpDevelop.lnk" Delete "$DESKTOP\SharpDevelop.lnk"
Delete "$SMPROGRAMS\SharpDevelop\*.*" Delete "$SMPROGRAMS\SharpDevelop\*.*"
; ExecShell "" "$INSTDIR\bin\tools\GacUtil2 /u ..\nunit.core.dll" "" SW_SHOWMINIMIZED
; ExecShell "" "$INSTDIR\bin\tools\GacUtil2 /u ..\nunit.framework.dll" "" SW_SHOWMINIMIZED
; first, remove all dependencies from the GAC etc ; first, remove all dependencies from the GAC etc
ExecWait '"$SYSDIR\cscript.exe" "$INSTDIR\bin\setup\PreUninstallTasks.vbs"' SetOutPath "$INSTDIR\bin\setup"
ExecWait '"$INSTDIR\bin\setup\PreUninstallTasks.bat"' $0
; set OutPath to somewhere else because the current working directory cannot be deleted!
SetOutPath "$DESKTOP"
RMDir "$SMPROGRAMS\SharpDevelop" RMDir "$SMPROGRAMS\SharpDevelop"
RMDir /r "$INSTDIR" RMDir /r "$INSTDIR"

10
setup/readme.txt

@ -2,11 +2,19 @@ The setup program is maintained by Christoph Wille, christophw@alphasierrapapa.c
Information Information
Setup uses NSIS 2.0 Release - http://nsis.sourceforge.net Setup uses NSIS 2.06 Release - http://nsis.sourceforge.net
CHANGELOG CHANGELOG
4/13/2005:
* Fixed installation in path with spaces.
4/12/2005:
* SetOutputPath
* Exclusion of directories
10/07/2004: 10/07/2004:
* Batch files replaced with WSH scripts * Batch files replaced with WSH scripts

15
src/Main/Base/Project/Src/Project/Solution/Solution.cs

@ -354,6 +354,17 @@ namespace ICSharpCode.SharpDevelop.Project
static Regex projectLinePattern = new Regex("Project\\(\"(?<ProjectGuid>.*)\"\\)\\s+=\\s+\"(?<Title>.*)\",\\s*\"(?<Location>.*)\",\\s*\"(?<Guid>.*)\"", RegexOptions.Compiled); static Regex projectLinePattern = new Regex("Project\\(\"(?<ProjectGuid>.*)\"\\)\\s+=\\s+\"(?<Title>.*)\",\\s*\"(?<Location>.*)\",\\s*\"(?<Guid>.*)\"", RegexOptions.Compiled);
static Regex globalSectionPattern = new Regex("\\s*GlobalSection\\((?<Name>.*)\\)\\s*=\\s*(?<Type>.*)", RegexOptions.Compiled); static Regex globalSectionPattern = new Regex("\\s*GlobalSection\\((?<Name>.*)\\)\\s*=\\s*(?<Type>.*)", RegexOptions.Compiled);
static string GetFirstNonCommentLine(TextReader sr)
{
string line = "";
while ((line = sr.ReadLine()) != null) {
line = line.Trim();
if (line.Length > 0 && line[0] != '#')
return line;
}
return "";
}
/// <summary> /// <summary>
/// Reads the specified solution file. The project-location-guid information is written into the conversion class. /// Reads the specified solution file. The project-location-guid information is written into the conversion class.
/// </summary> /// </summary>
@ -362,7 +373,7 @@ namespace ICSharpCode.SharpDevelop.Project
{ {
string solutionDirectory = Path.GetDirectoryName(solutionFileName); string solutionDirectory = Path.GetDirectoryName(solutionFileName);
using (StreamReader sr = File.OpenText(solutionFileName)) { using (StreamReader sr = File.OpenText(solutionFileName)) {
string line = sr.ReadLine(); string line = GetFirstNonCommentLine(sr);
Match match = versionPattern.Match(line); Match match = versionPattern.Match(line);
if (!match.Success) { if (!match.Success) {
return null; return null;
@ -391,7 +402,7 @@ namespace ICSharpCode.SharpDevelop.Project
bool needsConversion = false; bool needsConversion = false;
using (StreamReader sr = File.OpenText(fileName)) { using (StreamReader sr = File.OpenText(fileName)) {
string line = sr.ReadLine(); string line = GetFirstNonCommentLine(sr);
Match match = versionPattern.Match(line); Match match = versionPattern.Match(line);
if (!match.Success) { if (!match.Success) {
MessageService.ShowError(fileName + " is not a valid solution file."); MessageService.ShowError(fileName + " is not a valid solution file.");

Loading…
Cancel
Save