- NSIS Discussion
- Migration from 2.41 to 2.42 failed
Archive: Migration from 2.41 to 2.42 failed
Theresias
25th December 2008 13:07 UTC
Migration from 2.41 to 2.42 failed
First of all, once again thank you for an awesome tool which (once you put some work and thinking in your scripts) does exactly whats needed while being slim and simple for the end user. :up:
Now to the part where I have to ask for help. ;)
Even though we are using NSIS for a couple of years now, I have never come across a problem like this. My script works fine with NSIS 2.41 and it even compiles just fine with 2.42 but once you run it the installer claims to be "incomplete/broken".
Since there is no real run-time debugging, I frustrated myself with testing for quite a while and apparently this seems to be related to my installation directory or (which I think is more likely) the variables I am using to specify it.
I have read the release notes for 2.42 and came across the part with the plugins as well as header functions and their declaration. Sadly I was not able to find any details on the header function part.
P.S.: Please excuse me not posting the script itself since I am reluctant to do so, but if you want specific parts from it I am sure I can supply them.
Anders
25th December 2008 13:53 UTC
It would help if you could narrow down the problem a bit, and maybe come up with a minimal example that reproduces the problem
gbpa005
25th December 2008 16:02 UTC
Me too
I have the same problem. I use Eclipse with EclipseNSIS, but compiling the scripts with HMNSIEdit as well generates corrupt installers (Vista). I tried several different installation scripts (absolutely standard installers without any special function): The compilation with 2.41 is absolutely fine and there is no error message with 2.42. When starting the installer, Vista comes up with a "No valid Win32 application"-Error message. Switching back to 2.41 solves the problem.
If there is additional information, that I can give you (logs etc.), please let me know.
Bye
P.S.: A simple autogenerated sample script (EclipseNSIS), that as well causes the problem:
# Auto-generated by EclipseNSIS Script Wizard
# 25.12.2008 16:58:26
Name "My Application"
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
# MUI Symbol Definitions
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "My Application"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-colorful.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
# Included files
!include Sections.nsh
!include MUI2.nsh
# Variables
Var StartMenuGroup
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Installer languages
!insertmacro MUI_LANGUAGE German
# Installer attributes
OutFile setup.exe
InstallDir "$PROGRAMFILES\My Application"
CRCCheck on
XPStyle on
ShowInstDetails show
InstallDirRegKey HKLM "${REGKEY}" Path
ShowUninstDetails show
# Installer sections
Section -Main SEC0000
SetOutPath $INSTDIR
SetOverwrite on
File "C:\Program Files\Eclipse\notice.html"
WriteRegStr HKLM "${REGKEY}\Components" Main 1
SectionEnd
Section -post SEC0001
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath $SMPROGRAMS\$StartMenuGroup
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend
# Uninstaller sections
Section /o -un.Main UNSEC0000
Delete /REBOOTOK $INSTDIR\notice.html
DeleteRegValue HKLM "${REGKEY}\Components" Main
SectionEnd
Section -un.post UNSEC0001
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
DeleteRegValue HKLM "${REGKEY}" Path
DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKLM "${REGKEY}"
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
RmDir /REBOOTOK $INSTDIR
SectionEnd
# Installer functions
Function .onInit
InitPluginsDir
FunctionEnd
# Uninstaller functions
Function un.onInit
ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
FunctionEnd
Theresias
25th December 2008 16:26 UTC
Originally posted by Anders
It would help if you could narrow down the problem a bit, and maybe come up with a minimal example that reproduces the problem
I'll try but since the whole script is rather complicated by now stripping it is not so easy. So far my guess is that the problem is related to directly or file operations in my case since it only happens when creating shortcuts or creating/copying to the installation directory.
The exact error message in my case is "Beschädigtes Installations-Programm: ungültiger Befehlscode", which resembles "Damaged installation program: invalid operating code". Interesting though, the error occurs in different parts of the procedure depending on the operating system. On Windows Vista x64 is crashes earlier than for example Windows 98.
kichik
25th December 2008 23:34 UTC
Can you attach an example of a corrupt installer? I need the executable itself, not the script. Also, I'd try disabling any anti-virus programs just to make sure it's not a problem with a false positive.
gbpa005
26th December 2008 08:29 UTC
Here is an example: www.wolfgang.lenhard*******setup.exe
kichik
26th December 2008 10:31 UTC
gbpa005, it seems you're using old stubs with new plug-ins. Your stub doesn't have the new plug-in API in it. Are you sure you've properly installed everything? Try a complete uninstall and reinstall and make sure the NSIS folder is empty between them. Note that this will delete any special plug-ins you've installed into C:\Program Files\NSIS\Plugins, so back them up first.
Theresias, your problem is even more bizarre and my best theory for it is the anti-virus. A compiled installer would help best at understanding this.
gbpa005
26th December 2008 14:48 UTC
Hi Kichik,
I did a complete reinstall of NSIS, but the problem stays the same: http://www.wolfgang.lenhard*******setup2.exe
I did not install any plugins, just a clean installation from the sourceforge NSIS installer.
Bye,
Wolfgang
kichik
26th December 2008 18:10 UTC
Your stubs are still from the old version. Make sure C:\Program Files\NSIS\Stubs is clean before you reinstall. The stubs should have the following md5 sums:
f18bd2eba1b69083c7eea0e1f7080332 *bzip2
3d72747ff56ee61e3703911ef6207905 *bzip2_solid
116f5484e2b8e877d4115cb8af5df10f *lzma
21b89230e9b293d8cdf1618da17f63b9 *lzma_solid
f3885e2b42ee5b16289d12ff1790b48f *zlib
7afcb25acd4f874a7fe6b29b90b9699c *zlib_solid
gbpa005
26th December 2008 19:08 UTC
I completely deleted the NSIS folder (and all stubs) before reinstalling and I tried so several times. Unless Vista is hiding something from me, the wrong stubs come with the current installer.
kichik
26th December 2008 20:38 UTC
I used the current installer to get those md5 sums. Maybe you're using stubs from a different folder by mistake. Try opening C:\Program Files\NSIS\makensisw.exe manually instead of using any shortcuts.
gbpa005
28th December 2008 18:38 UTC
Ok, it was the usual Vista confusion. There had been a directory under VirtualStore, that contained the old stubs. This might pose a problem for a good number of people, who are updating from an older NSIS version. Deleting the folder "VirtualStore\Program Files\NSIS" solves the problem.
Bye,
Wolfgang
Theresias
29th December 2008 01:08 UTC
kichik, I put our faulty installer online and sent you a link via PM. Thanks for taking the time to look into it.
BTW: I'm very certain this is not anti-virus related since some of the test systems we are using are running in a virtual environment without any protection of some sort. Also haven't totally reinstalled NSIS yet as suggested with gbpa005's problem, will try that tomorrow.