You are here

Custom Segment problem for PA.c Launcher

7 posts / 0 new
Last post
alysher
Offline
Last seen: 6 years 6 months ago
Joined: 2010-10-28 13:47
Custom Segment problem for PA.c Launcher

ok, from what i understand if i wish to include custom segments for the PA.c Launcher i must have a file named PortableApps.comLauncherCustom.nsh in my source directory.

now if i want to add several segments i would have the PortableApps.comLauncherCustom.nsh file and any files called by PortableApps.comLauncherCustom.nsh

for example, here would be one part of my custom segment

PortableApps.comLauncherCustom.nsh code


!include "GetDXVersion.nsh"

Section "Main"
CheckDirectXVersion:
Call GetDXVersion
Pop $R0
IntCmp $R0 801 GetINIOptions 0 GetINIOptions
MessageBox MB_OK|MB_ICONEXCLAMATION "${FULLNAME} requires DirectX 8.1 or later to be installed."
Abort

SectionEnd

and i would also have a file named GetDXVersion.nsh in the same directory as PortableApps.comLauncherCustom.nsh

am i correct or have i missed something?

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Not custom code

Try this:

${SegmentFile}

!include "${PACKAGE}\Other\Source\GetDXVersion.nsh"

${SegmentInit}
  Call GetDXVersion
  Pop $R0
  ${If} $R0 

Previously known as kAlug.

alysher
Offline
Last seen: 6 years 6 months ago
Joined: 2010-10-28 13:47
ummm....

ok first how do you do the box?

second: so any code that i need to add would be in this format?

third: each segment would be separate correct?

Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
HTML; yes; not exactly
  1. Use <pre></pre>
  2. Right
  3. No. Each segment hook specifies when to run, not a specific task. More in the manual

Previously known as kAlug.

alysher
Offline
Last seen: 6 years 6 months ago
Joined: 2010-10-28 13:47
ok, new custom segment issue.

ok, new custom segment issue. i want to check the version of windows the app is running on, and then depending on if it is less then say vista i want it to run the GetDXVersion. here is what i have:

${SegmentFile}

!include "${PACKAGE}\Other\Source\GetDXVersion.nsh"
!include "WinVer.nsh"

${SegmentInit}
  Call GetDXVersion
  Call ${GetWindowsVersion} $R0
  Pop $0
  ${IfNot} {$AtLeastWinXP}
    ${If} $0 
now i THINK this will work, but is there an easier way to get this to do what i want it to do?

or if i have something wrong here what am i missing?
Aluísio A. S. G.
Offline
Last seen: 7 years 9 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Try this

From where is GetWindowsVersion coming from?

${SegmentFile}

!include "${PACKAGE}\Other\Source\GetDXVersion.nsh"
!include "WinVer.nsh"

${SegmentInit}
  ${IfNot} {$AtLeastWinVista}
    Call GetDXVersion
    Pop $R0
    ${If} $R0 

Previously known as kAlug.

alysher
Offline
Last seen: 6 years 6 months ago
Joined: 2010-10-28 13:47
Opps....misread something.

when i decided to inplement checking the os level b4 checking for directx i checked nsis.sourceforge.net for a get windows version nsh that i could implement and misread how to use it... the GetWindowsVersion is from the obsolete script that is on the site...the winver.nsh that is included with the portable version of nsis had instructions that i never read before seeing your code. thank you for the help!

Log in or register to post comments