NSIS Wiki:Sandbox: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
mNo edit summary
 
(43 intermediate revisions by 20 users not shown)
Line 5: Line 5:
Keep the page content below this note.
Keep the page content below this note.


[[Category:Browse Wiki Maintenance Services by Name]]
<hr />
<!-- keep the note above intact and put the page content right below -->
 
This is only a test.
 
test captcha


<!-- keep the note above intact and put the page content right below -->
<hr />
If you are reaching this page from an error message, you are having a problem installing a program. The installer file is incomplete or modified from the original file.


Due to software limitations, the developer can not change the contents of this error message. This page helps to bridge the gap between the problem and the solution. While this page will outline basic solutions:
The quick brown fox jumps over the lazy dog.
 
<span id="anchor_name"></span>
== Some long complicated title that no one would want to refer to directly ==
 
LIBRARY SYSTEM OF THE FISHER VALLEY
kjnb/'/l,m'l'lk
 
<code>
!include "MUI2.nsh"  # change this to !include MUI.nsh to see how the code works successfully for MUI1
 
; Local bitmap path.
!define BITMAP_FILE res.bmp
 
; --------------------------------------------------------------------------------------------------
; Installer Settings
; --------------------------------------------------------------------------------------------------
Name "Background Bitmap"
OutFile "bgbitmap.exe"
ShowInstDetails show
; !define MUI_HEADERIMAGE #  this is responsible for the big window
; !define MUI_UI_HEADERIMAGE ".\dimm_beta_img.exe" # modded exe
; --------------------------------------------------------------------------------------------------
; Modern UI Settings
; --------------------------------------------------------------------------------------------------
!define MUI_COMPONENTSPAGE_NODESC
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_CUSTOMFUNCTION_GUIINIT MyGUIInit


'''Please contact the publisher or developer of the program you are installing for complete support.'''
; --------------------------------------------------------------------------------------------------
; Definitions
; --------------------------------------------------------------------------------------------------
!ifndef LR_LOADFROMFILE
    !define LR_LOADFROMFILE    0x0010
!endif
!ifndef LR_CREATEDIBSECTION
    !define LR_CREATEDIBSECTION 0x2000
!endif
!ifndef IMAGE_BITMAP
    !define IMAGE_BITMAP        0
!endif
!ifndef SS_BITMAP
    !define SS_BITMAP          0x0000000E
!endif
!ifndef WS_CHILD
    !define WS_CHILD            0x40000000
!endif
!ifndef WS_VISIBLE
    !define WS_VISIBLE          0x10000000
!endif
!define HWND_TOP            0
!define SWP_NOSIZE          0x0001
!define SWP_NOMOVE          0x0002
!define IDC_BITMAP          1500
!define stRECT "(i, i, i, i) i"
Var hBitmap


==What does this message mean?==
; --------------------------------------------------------------------------------------------------
; Pages
; --------------------------------------------------------------------------------------------------
!define MUI_PAGE_CUSTOMFUNCTION_SHOW WelcomePageShow
!insertmacro MUI_PAGE_WELCOME


The installer has failed a self-check. This means that for some reason, the installer file has been modified from it's original form. If the install were to continue, the software install would not be complete and will be broken. To prevent further problems, the installer refused to continue.
!insertmacro MUI_LANGUAGE English


==How do I fix the problem?==
; --------------------------------------------------------------------------------------------------
There are a number of ways the installer can be modified, but we'll cover steps to fix the problem on your end. If all these steps don't work, please contact the developers or publishers of the software you are attempting to install or your normal computer support channels.
; Macros
; --------------------------------------------------------------------------------------------------
; Destroy a window.
!macro DestroyWindow HWND IDC
    GetDlgItem $R0 ${HWND} ${IDC}
    System::Call `user32::DestroyWindow(i R0)`
!macroend


# [[wikipedia:Bypass_your_cache|Clear your browser's cache.]]
; Give window transparent background.
# Disable any [[wikipedia:Download_manager|download accelerators or managers]] and download the installer again.
!macro SetTransparent HWND IDC
# Rename the installer so it is a simple one-word name with no special characters (without removing the .exe suffix)
    GetDlgItem $R0 ${HWND} ${IDC}
#* Example: install.exe
    SetCtlColors $R0 0x444444 transparent
# Download the installer from another source approved by the software developer or publisher.
!macroend
#* It might be corrupted on the server, or the connection to the server is unreliable from your location.
# Update your anti-virus software (if installed) and download the installer again.
# Disable your anti-virus software and download the installer again.
# Download the installer using another computer and copy it to the original computer.
# If you have the nVidia firewall installed, [http://forums.winamp.com/showthread.php?postid=1895971#post1895971 uninstall the program] and download the installer again.
# Scan for, and remove [[wikipedia:Malware|malware]] and [[wikipedia:Computer virus|viruses]] on your system.
# Scan the hard drive using [[wikipedia:Scandisk|scandisk]], [[wikipedia:CHKDSK|chkdsk]], or any other hard drive repair tool.


As a last resort, the installer can be executed even though it's corrupted. To bypass the corruption test, pass ''/NCRC'' on the command line. To do so, go to ''Start->Run'', type ''cmd'' and hit ''Enter''. A black console window should open. Drag the installer into the window, hit ''Space'' and type ''/NCRC''. Hit ''Enter'' again and the installer should start. This is '''not recommended'''!
; Refresh window.
!macro RefreshWindow HWND IDC
    GetDlgItem $R0 ${HWND} ${IDC}
    ShowWindow $R0 ${SW_HIDE}
    ShowWindow $R0 ${SW_SHOW}
!macroend


When all else fails, you will need to contact either the developers of the software you're attempting to download or your personal computer support channels.
; --------------------------------------------------------------------------------------------------
; Functions
; --------------------------------------------------------------------------------------------------
Function MyGUIInit
    ; Extract bitmap image.
    InitPluginsDir
    ReserveFile `${BITMAP_FILE}`
    File `/ONAME=$PLUGINSDIR\res.bmp` `${BITMAP_FILE}`
    ; Get the size of the window.
    System::Call `*${stRECT} .R0`
    System::Call `user32::GetClientRect(i $HWNDPARENT, i R0)`
    System::Call `*$R0${stRECT} (, , .R1, .R2)`
    System::Free $R0
    ; Create bitmap control.
    System::Call `kernel32::GetModuleHandle(i 0) i.R3`
    System::Call `user32::CreateWindowEx(i 0, t "STATIC", t "", i ${SS_BITMAP}|${WS_CHILD}|${WS_VISIBLE}, i 0, i 0, i R1, i R2, i $HWNDPARENT, i ${IDC_BITMAP}, i R3, i 0) i.R1`
    System::Call `user32::SetWindowPos(i R1, i ${HWND_TOP}, i 0, i 0, i 0, i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE})`
    ; Set the bitmap.
    System::Call `user32::LoadImage(i 0, t "$PLUGINSDIR\res.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s`
    Pop $hBitmap
    SendMessage $R1 ${STM_SETIMAGE} ${IMAGE_BITMAP} $hBitmap
    ; Set transparent backgrounds.
    !insertmacro SetTransparent $HWNDPARENT 3
    !insertmacro SetTransparent $HWNDPARENT 1
    !insertmacro SetTransparent $HWNDPARENT 2
    !insertmacro SetTransparent $HWNDPARENT 1034
    !insertmacro SetTransparent $HWNDPARENT 1037
    !insertmacro SetTransparent $HWNDPARENT 1038
    !insertmacro SetTransparent $HWNDPARENT 1028
    !insertmacro SetTransparent $HWNDPARENT 1256
    ; !insertmacro SetTransparent $HWNDPARENT 1045
    !insertmacro SetTransparent $HWNDPARENT 1035
    ; Remove unwanted controls.
    !insertmacro DestroyWindow  $HWNDPARENT 1256
    !insertmacro DestroyWindow  $HWNDPARENT 1028
    ; !insertmacro DestroyWindow  $HWNDPARENT 1039
    !insertmacro DestroyWindow  $HWNDPARENT 1045    # dimm remove line from bottom
    ; !insertmacro DestroyWindow  $HWNDPARENT 1035
    ; !insertmacro DestroyWindow  $HWNDPARENT 1256
FunctionEnd


==NSIS Error Messages==


For public record, here are what the NSIS error messages look like:
Function RefreshParentControls
    !insertmacro RefreshWindow  $HWNDPARENT 1037
    !insertmacro RefreshWindow  $HWNDPARENT 1038
FunctionEnd


<pre>Installer integrity check has failed. Common causes include
Function WelcomePageShow
incomplete download and damaged media. Contact the
      # Sets background image
installer's author to obtain a new copy.
    System::Call `user32::LoadImage(i 0, t "$PLUGINSDIR\res.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s`
    Pop $hBitmap
    ; SendMessage $bitmapWindow ${STM_SETIMAGE} ${IMAGE_BITMAP} $hBitmap
      # Start solution
    SetCtlColors $mui.WelcomePage ${CTRL_COLOUR} transparent
    SetCtlColors $mui.WelcomePage.text ${CTRL_COLOUR} transparent
    SetCtlColors $mui.WelcomePage.title 0x333333 transparent
    !insertmacro DestroyWindow  $HWNDPARENT 1037
    !insertmacro DestroyWindow  $HWNDPARENT 1038
    !insertmacro DestroyWindow  $HWNDPARENT 1036
    SetCtlColors $0 222425 transparent
    System::Call `user32::DestroyWindow(i $mui.WelcomePage.Image)`


More information at:
    Call RefreshParentControls
http://nsis.sf.net/NSIS_Error</pre>
FunctionEnd
In NSIS versions prior to 2.35 (independent of installed software), the error states:
    ; BrandingText ""
<pre>The installer you are trying to use is corrupted or incomplete.
This could be the result of a damaged disk, a failed download or a virus.


You may want to contact the author of this installer to obtain a new copy.
; Free loaded resources.
Function .onGUIEnd
    ; Destroy the bitmap.
    System::Call `gdi32::DeleteObject(i s)` $hBitmap
FunctionEnd


It may be possible to skip this check using the /NCRC command line switch
; --------------------------------------------------------------------------------------------------
(NOT RECOMMENDED).</pre>
; Dummy section
; --------------------------------------------------------------------------------------------------
Section "Dummy Section"
SectionEnd


==Why can't NSIS help me? You made the software, right?==
</code>


NSIS developed the "envelope" that contains the software you are attempting to install, not the software itself. NSIS is an open-source community that develops the software which ''installs'' software under [[License|open-source licenses]]. This allows any software developer, including you, to use NSIS to ease the process of installing software. The problems you are having involve an outside party modifying the installer and is beyond NSIS' control.
==CSS==


Again, we stress that you contact the developer or publisher of the software you are attempting to install. NSIS did not create the software you are attempting to install and therefor NSIS can not help you beyond the steps outlined on this page.
<code>O01lI</code><hr>
<code style="font-family: monospace;">O01lI</code><hr>
<code style="font-family: monospace,monospace;">O01lI</code><hr>
<code style="font-family: monospace,serif;">O01lI</code><hr>
<pre>O01lI</pre><hr>
<pre style="font-family: monospace;">O01lI</pre><hr>
<pre style="font-family: monospace,monospace;">O01lI</pre><hr>
<pre style="font-family: monospace,serif;">O01lI</pre><hr>

Latest revision as of 17:15, 15 April 2023

This is where test stuff should be posted, if you don't know how things appear, or want to test if something works which can't be seen by just previewing the page.

Right now, there is nothing being done to this page regularly to delete contents. Maybe a bot or the server will be used for the task, but nothing is sure.

Keep the page content below this note.


This is only a test.

test captcha


The quick brown fox jumps over the lazy dog.

Some long complicated title that no one would want to refer to directly

LIBRARY SYSTEM OF THE FISHER VALLEY kjnb/'/l,m'l'lk

!include "MUI2.nsh" # change this to !include MUI.nsh to see how the code works successfully for MUI1


Local bitmap path.

!define BITMAP_FILE res.bmp

--------------------------------------------------------------------------------------------------
Installer Settings
--------------------------------------------------------------------------------------------------

Name "Background Bitmap" OutFile "bgbitmap.exe" ShowInstDetails show

!define MUI_HEADERIMAGE # this is responsible for the big window
!define MUI_UI_HEADERIMAGE ".\dimm_beta_img.exe" # modded exe
--------------------------------------------------------------------------------------------------
Modern UI Settings
--------------------------------------------------------------------------------------------------

!define MUI_COMPONENTSPAGE_NODESC !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_CUSTOMFUNCTION_GUIINIT MyGUIInit

--------------------------------------------------------------------------------------------------
Definitions
--------------------------------------------------------------------------------------------------

!ifndef LR_LOADFROMFILE

   !define LR_LOADFROMFILE     0x0010

!endif !ifndef LR_CREATEDIBSECTION

   !define LR_CREATEDIBSECTION 0x2000

!endif !ifndef IMAGE_BITMAP

   !define IMAGE_BITMAP        0

!endif !ifndef SS_BITMAP

   !define SS_BITMAP           0x0000000E

!endif !ifndef WS_CHILD

   !define WS_CHILD            0x40000000

!endif !ifndef WS_VISIBLE

   !define WS_VISIBLE          0x10000000

!endif !define HWND_TOP 0 !define SWP_NOSIZE 0x0001 !define SWP_NOMOVE 0x0002 !define IDC_BITMAP 1500 !define stRECT "(i, i, i, i) i" Var hBitmap

--------------------------------------------------------------------------------------------------
Pages
--------------------------------------------------------------------------------------------------

!define MUI_PAGE_CUSTOMFUNCTION_SHOW WelcomePageShow !insertmacro MUI_PAGE_WELCOME

!insertmacro MUI_LANGUAGE English

--------------------------------------------------------------------------------------------------
Macros
--------------------------------------------------------------------------------------------------
Destroy a window.

!macro DestroyWindow HWND IDC

   GetDlgItem $R0 ${HWND} ${IDC}
   System::Call `user32::DestroyWindow(i R0)`

!macroend

Give window transparent background.

!macro SetTransparent HWND IDC

   GetDlgItem $R0 ${HWND} ${IDC}
   SetCtlColors $R0 0x444444 transparent

!macroend

Refresh window.

!macro RefreshWindow HWND IDC

   GetDlgItem $R0 ${HWND} ${IDC}
   ShowWindow $R0 ${SW_HIDE}
   ShowWindow $R0 ${SW_SHOW}

!macroend

--------------------------------------------------------------------------------------------------
Functions
--------------------------------------------------------------------------------------------------

Function MyGUIInit

   ; Extract bitmap image.
   InitPluginsDir
   ReserveFile `${BITMAP_FILE}`
   File `/ONAME=$PLUGINSDIR\res.bmp` `${BITMAP_FILE}`
   ; Get the size of the window.
   System::Call `*${stRECT} .R0`
   System::Call `user32::GetClientRect(i $HWNDPARENT, i R0)`
   System::Call `*$R0${stRECT} (, , .R1, .R2)`
   System::Free $R0
   ; Create bitmap control.
   System::Call `kernel32::GetModuleHandle(i 0) i.R3`
   System::Call `user32::CreateWindowEx(i 0, t "STATIC", t "", i ${SS_BITMAP}|${WS_CHILD}|${WS_VISIBLE}, i 0, i 0, i R1, i R2, i $HWNDPARENT, i ${IDC_BITMAP}, i R3, i 0) i.R1`
   System::Call `user32::SetWindowPos(i R1, i ${HWND_TOP}, i 0, i 0, i 0, i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE})`
   ; Set the bitmap.
   System::Call `user32::LoadImage(i 0, t "$PLUGINSDIR\res.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s`
   Pop $hBitmap
   SendMessage $R1 ${STM_SETIMAGE} ${IMAGE_BITMAP} $hBitmap
   ; Set transparent backgrounds.
   !insertmacro SetTransparent $HWNDPARENT 3
   !insertmacro SetTransparent $HWNDPARENT 1
   !insertmacro SetTransparent $HWNDPARENT 2
   !insertmacro SetTransparent $HWNDPARENT 1034
   !insertmacro SetTransparent $HWNDPARENT 1037
   !insertmacro SetTransparent $HWNDPARENT 1038
   !insertmacro SetTransparent $HWNDPARENT 1028
   !insertmacro SetTransparent $HWNDPARENT 1256
   ; !insertmacro SetTransparent $HWNDPARENT 1045
   !insertmacro SetTransparent $HWNDPARENT 1035
   ; Remove unwanted controls.
   !insertmacro DestroyWindow  $HWNDPARENT 1256
   !insertmacro DestroyWindow  $HWNDPARENT 1028
   ; !insertmacro DestroyWindow  $HWNDPARENT 1039 
   !insertmacro DestroyWindow  $HWNDPARENT 1045     # dimm remove line from bottom
   ; !insertmacro DestroyWindow  $HWNDPARENT 1035
   ; !insertmacro DestroyWindow  $HWNDPARENT 1256

FunctionEnd


Function RefreshParentControls

   !insertmacro RefreshWindow  $HWNDPARENT 1037
   !insertmacro RefreshWindow  $HWNDPARENT 1038

FunctionEnd

Function WelcomePageShow

     # Sets background image
   System::Call `user32::LoadImage(i 0, t "$PLUGINSDIR\res.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s`
   Pop $hBitmap
   ; SendMessage $bitmapWindow ${STM_SETIMAGE} ${IMAGE_BITMAP} $hBitmap
      # Start solution
   SetCtlColors $mui.WelcomePage ${CTRL_COLOUR} transparent
   SetCtlColors $mui.WelcomePage.text ${CTRL_COLOUR} transparent
   SetCtlColors $mui.WelcomePage.title 0x333333 transparent
   !insertmacro DestroyWindow  $HWNDPARENT 1037
   !insertmacro DestroyWindow  $HWNDPARENT 1038
   !insertmacro DestroyWindow  $HWNDPARENT 1036 
   SetCtlColors $0 222425 transparent
   System::Call `user32::DestroyWindow(i $mui.WelcomePage.Image)`
   Call RefreshParentControls

FunctionEnd

   ; BrandingText ""
Free loaded resources.

Function .onGUIEnd

   ; Destroy the bitmap.
   System::Call `gdi32::DeleteObject(i s)` $hBitmap

FunctionEnd

--------------------------------------------------------------------------------------------------
Dummy section
--------------------------------------------------------------------------------------------------

Section "Dummy Section" SectionEnd

CSS

O01lI


O01lI


O01lI


O01lI


O01lI

O01lI

O01lI

O01lI