RequestExecutionLevel admingo? In the beginning: !define RequestExecutionLevel admin?
Where does
57 posts
RequestExecutionLevel admingo? In the beginning: !define RequestExecutionLevel admin?
7C810847 mov eax,dword ptr [esi]unless that request execution caused it?
We are going to need some more details.Originally Posted by jweinraub View PostI don't know if its related but other than fixing a few logical errors (by removing the old winver stuff), the code compiles but crashes (no error, visual studio JIT caught it and the disassembly makes no sense).
unless that request execution caused it?
Yes. welcome msgbox showed, then crash. good idea, now i will iterate through it until i find the cause. i am guessing it is a plugin.Originally Posted by JasonFriday13 View PostSo put in a MessageBox on the first line in .onInit and see if it shows. If it does show then there is a problem with the script somewhere.
its removal allows the installer to work.
${IfNot} ${AtLeastWinXP}
MessageBox MB_OK|MB_ICONSTOP "Your installed version of Windows is not supported by the Foobar software." IDOK
Quit
${EndIf}
MessageBox MB_OK "We are now past AtLeastXP" IDOK
${If} ${IsWin8}
${OrIf} ${IsWin8.1}
MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_TOPMOST|MB_DEFBUTTON2 \
"This Foobar software is being tested on, but is not fully supported on Windows 8.$\r$\n$\r$\nFoobar Enterprises cannot \
provide technical support for this installation.$\r$\n$\r$\nDo you still want to continue with the installation?" \
IDYES further IDNO done
${EndIf}
MessageBox MB_OK "We are now passed Win8 checks" IDOK
Name "Test (${NSIS_PACKEDVERSION}:${NSIS_CHAR_SIZE}:${NSIS_PTR_SIZE})"Works fine on XP.SP3, Win8.RTM and Win10.TP
Outfile "$%Temp%\Test.exe"
RequestExecutionLevel user
!include WinVer.nsh
Function .onInit
${IfNot} ${AtLeastWinXP}
MessageBox MB_OK|MB_ICONSTOP "Your installed version of Windows is not supported by the Foobar software." IDOK
Quit
${EndIf}
MessageBox MB_OK "We are now past AtLeastXP" IDOK
${If} ${IsWin8}
${OrIf} ${IsWin8.1}
MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_TOPMOST|MB_DEFBUTTON2 \
"This Foobar software is being tested on, but is not fully supported on Windows 8.$\r$\n$\r$\nFoobar Enterprises cannot \
provide technical support for this installation.$\r$\n$\r$\nDo you still want to continue with the installation?" \
IDYES further IDNO done
${EndIf}
further:
done:
MessageBox MB_OK "We are now passed Win8 checks" IDOK
FunctionEnd
Section
SectionEnd
Win10 is detected as Win8.1 because of the way compatibility hacks are applied to GetVersionEx by Windows. ${IsServerOS} is used to detect server versions. 2012 and 2012R2 will be detected as "Win8" in your code because the version number is the same as the client versions...Originally Posted by jweinraub View PostI assume my code logic is right to prohibit anything below XP, warning for the 8s and anything else (Vista, 7, 8+) to work? Including server versions?
ManifestSupportedOS Win7 Win8 Win8.1 {8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0
!define ALL_USERS
!define RequestExecutionLevel admin
# Remove the filter....
nsExec::Exec '"$windir\sysnative\netcfg.exe" -u foobar' $R1
Verify that the process is started with the command line you expect by using Process Explorer or Process Monitor, beyond that I don't think we can be of much help and you probably have to return to the OSR mailing list...Originally Posted by jweinraub View Postbut uninstalling doesn't do anything.
; Detect .net 2.0 here ;
System::Call `mscoree::GetCORVersion(w .R0, i ${NSIS_MAX_STRLEN}, *i) ?u`
StrCpy $R0 $R0 1 1
; Compare if $R0 < 2 using ${If}
${If} $R0 < 2
; First detect if this is a 64 bit OS because you will want to install that instead ...
${AndIf} ${RunningX64} ; it seems this happens regardless if 2.0 is installed already or not. b/c of the and.
SetDetailsPrint textonly
DetailPrint "Installing Microsoft .NET 2.0 x64. This may take up to ten minutes, please be patient."
SetDetailsPrint none
ExecWait `"$INSTDIR\Misc\NetFx64.exe" /q:a /c:"install.exe /noaspupgrade /qb"` $R0
${Else} ; so does this
SetDetailsPrint textonly
DetailPrint "Installing Microsoft .NET 2.0..."
SetDetailsPrint none
ExecWait `"$INSTDIR\Misc\dotnetfx.exe" /q:a /c:"install.exe /noaspupgrade /qb"` $R0
${EndIf}
; this doesnt happen on XP now for some reason.
FooPlug::Show
${If} $1 == "YES"
Goto install_foo
${Else}
Goto skip_it
${EndIf}
System::Call `mscoree::GetCORVersion(w .R0, i ${NSIS_MAX_STRLEN}, *i) ?u`
StrCpy $R0 $R0 1 1
${If} $R0 < 2
; .net 2 not installed, install it now:
${If} ${RunningX64}
ExecWait `"$INSTDIR\Misc\NetFx64.exe" /q:a /c:"install.exe /noaspupgrade /qb"` $R0
${Else}
ExecWait `"$INSTDIR\Misc\dotnetfx.exe" /q:a /c:"install.exe /noaspupgrade /qb"` $R0
${EndIf}
${EndIf}
Where would that go exactly?Originally Posted by Anders View PostInitOnceExecuteOnce was added in Vista IIRC. Use a critical section or InterlockedCompareExchange if you need to support older platforms...
void setvar( int varnum, char * var )
{
if (var != NULL && varnum >= 0 && varnum < __INST_LAST)
{
lstrcpy (g_variables + varnum*g_stringsize, var);
}
}
// Gets user variable
char *getvar(int varnum)
{
if (varnum < 0 || varnum >= __INST_LAST)
return NULL;
return g_variables + varnum*g_stringsize;
}
void __declspec(dllexport) Show(HWND hwndParent, int string_size, char *variables, stack_t **stacktop)
{
g_hwndParent=hwndParent;
g_stringsize=string_size;
g_variables=variables;
res = runDialogBox();
if ( res == 0 )
setvar(INST_1,"NO" );
else
setvar(INST_1,"YES" );
}
int runDialogBox()
{
int result = FALSE;
result = DialogBoxParam(hModule, MAKEINTRESOURCE(IDD_DIALOG), NULL, dlgBox, NULL);
return result;
}