Jump to content

Recommended Posts

Posted

hi

i am using inno setup complier to make my setup file. i have two files, one is .exe file and another is .dll file and couple of .jpg files. i want to run the .exe file whenever the user starts his computer, in other words i want to make my program load on startup. but i don't want to make it run from startup folder. i want it to run from registry, which means i want a script inno setup script which will make the program run on startup from the registry. what should i do in inno setup compiler to make my program run on startup from the registry.

plz help,

thanks in advance,

regards,

Ray


Posted

The fastest start from registry is:

[Registry]

Root: HKU; Subkey: S-1-5-21-1606980848-1202660629-1801674531-1004\Software\Microsoft\Windows\CurrentVersion\Run; ValueName: Application; ValueType: String; ValueData: {app}\Application.exe; Tasks: start_with_win; Flags: uninsdeletevalue

And if you want it as task:

[Tasks]

Name: start_with_win; Description: Start the program at Windows startup; Languages: en

Posted

hi all

thank you geezery and Inferi0r for ur suggestions and ideas for my query.

well i wanted to ask 1 more thing, before that please have a look at the following file structure.

Files pattern:

A.exe - This file is the main file.

b.exe - This is the file which is installed on the target computer if the user opens A.exe file.

c.dll - This is the supporting file , which is also installed on the target computer if the

user opens A.exe file

Now, i have a file its a "A.exe" file which, when opened installs two files one is "b.exe" and another is "c.dll".

so what i wanted was to take the first file "A.exe" into inno setup, make it run as the main executable file, this way it will install "b.exe" and "c.dll" file. And make the file "b.exe" start, at the startup from registry.

now my question to you is, does my idiotic genius plan work?

regards,

Posted (edited)

Of course it works, but the way you are doing it sounds a bit difficult:)

Here is one NSIS script that I make. There is also a regwrite to the Run path.

;Sample NSIS silent installation script by Geezery
;
;Name of the program
Name "YZShadow"

;Name of the executable file
OutFile "YZShadow_setup.exe"

;Installation path
InstallDir "$PROGRAMFILES\YZShadow\"

;Silent installation / uninstallation by default. You don't need any installation switches for example "/S"
SilentInstall silent
SilentUnInstall silent

;Name of the Installation section
Section "Installation"

;Select the files you want to include to your installation (Local path = Where the files are in your hard disk)
SetOutPath "$INSTDIR"
File /r C:\Add\yz\*.*


;We need to add this, if we want to include the uninstaller.
WriteUninstaller "uninst.exe"

;Here we add the program to startup

WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "YzShadow" "@ProgFiles\YzShadow\YzShadow.exe"

;Here we can specify the shortcuts to create

;Creates a new group in Start Menu / Programs group called S&M
CreateDirectory "$SMPROGRAMS\YZShadow"
;Then we create shortcuts for uninstall and the program file.
CreateShortCut "$SMPROGRAMS\YZShadow\YZShadow.lnk" "$INSTDIR\YZShadow.exe"
CreateShortCut "$SMPROGRAMS\YZShadow\Uninstall.lnk" "$INSTDIR\Uninst.exe"

SectionEnd


;Uninstallation Section - Here we specify, what we need to remove

Section "Uninstall"

DeleteRegValue HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "YzShadow"


;Deletes all the files

Delete "$INSTDIR\*.*"
RMDir "$INSTDIR"

;Remove the links
Delete "$SMPROGRAMS\YZShadow\*.*"
RMDir "$SMPROGRAMS\YZShadow"

SectionEnd

Edited by geezery

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...