You are here

NSIS

9 posts / 0 new
Last post
powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
NSIS

hey i need to modify some registry entries, essentially i am trying to make an app portable that makes a registry entry.
how do I use C++ do delete a registry entry?
I am sort of changing the question now, how do the portable apps here deal with the registry(like firefox, 7-zip), how do you keep things from popping up in the registry

here is the code

Name RegBinExample
OutFile test2.exe
ShowInstDetails show
LicenseData "lic.txt"
;=== Runtime Switches
SetCompress Auto
SetCompressor /SOLID lzma
SetCompressorDictSize 32
SetDatablockOptimize On
CRCCheck on
AutoCloseWindow True
RequestExecutionLevel user

;=== Include
!include MUI.nsh
!include FileFunc.nsh
!include LogicLib.nsh
!insertmacro DriveSpace
!insertmacro GetOptions
!insertmacro GetDrives
!insertmacro GetRoot
!insertmacro GetSize
!insertmacro GetParent
page license
Section -
;;;;;;;;;;;;;;
SectionEnd
Var FOUNDPORTABLEAPPSPATH
page custom main
Function main
${GetDrives} "HDD+FDD" GetDrivesCallBack
		StrCpy $INSTDIR "$FOUNDPORTABLEAPPSPATH\ASPPortable\Data\www"
  StrCpy $R0 "2"
  ;Write the value in one step
  RegBin::writeRegBin "HKCU" "SOFTWARE\Pablo Software Solutions\babyweb\settings" "UsageCount" $R0
        WriteRegStr HKCU "SOFTWARE\Pablo Software Solutions\babyweb\settings" 'webpages' $INSTDIR
ExecShell "" "test\test2\mstsc.exe"
FunctionEnd
Function GetDrivesCallBack
	;=== Skip usual floppy letters
	StrCmp $8 "FDD" "" CheckForPortableAppsPath
	StrCmp $9 "A:\" End
	StrCmp $9 "B:\" End
	
	CheckForPortableAppsPath:
		IfFileExists "$9PortableApps" "" End
			StrCpy $FOUNDPORTABLEAPPSPATH "$9PortableApps"

	End:
		Push $0
FunctionEnd

so what do i do next?
thanks

John Bentley
John Bentley's picture
Offline
Last seen: 15 years 4 months ago
Developer
Joined: 2006-01-24 13:26
Windows API. See MSDN

Windows API. See MSDN Reference.

(Hint #include <windows.h>)

cowsay Moo
cowthink 'Dude, why are you staring at me.'

ZachHudock
ZachHudock's picture
Offline
Last seen: 1 year 11 months ago
Developer
Joined: 2006-12-06 18:07
The apps here have a

The apps here have a wrapper, written in the NSIS scripting language, and the NSIS wrapper handles the registry entries, the APPDATA folder, and all that other not so portable stuff.

The developer formerly known as ZGitRDun8705

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
ummm....

what does that mean??

Please search before posting. ~Thanks

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
ok i used the NSIS wrapper

ok i used the NSIS wrapper but how do i get it to delete the registry entries after the main program is executed.

Please search before posting. ~Thanks

Patrick Patience
Offline
Last seen: 4 years 12 months ago
DeveloperModerator
Joined: 2007-02-20 19:26
Look at 7-Zip

Although they are old techniques, look at 7-Zip Portable launcher for ideas, or read the FAQ Page or Readme on the Registry plugin.

rab040ma
Offline
Last seen: 5 months 3 weeks ago
Joined: 2007-08-27 13:35
ExecWait

The big picture is to get your NSIS launcher to launch the app, but wait for it; when it ends, go clean up after it.

The key is ExecWait, which puts the NSIS script to sleep while the app is running. When the app finishes, NSIS picks up at the next instruction.

Is that what you are asking? Or do you need the exact commands for registry manipulation.

MC

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
tats what i want

thanks
with ninja command and this, you are a lifesaver!!

Please search before posting. ~Thanks

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
thanks to all ASPPortable is up

a couple more things please
when the program checks the drives it looks at only flash or hard drives.
Is there a way i can get it to look for the existing dir on CD drives as well
thanks
powerjuce

Please search before posting. ~Thanks

Log in or register to post comments