Jump to content

Installing a .reg file


Recommended Posts

Hey all,

I am a noob...

That said, I am trying to create an installer for a little program I made, I tried using an actual installer creator type program but it was way too confusing, so far auto it works perfectly except for the registry part which I found on a post in the forums...

run("c:windowsregedit.exe /s c:myregfile.reg")

I thought that was install the file in silent mode?? but nothing happens, I dont mind if it pops up and asks the user to confirm changes to the registry if thats an easier option??

The files get copied using fileinstall but the registry does not get edited :(

Please help!! :)

Thanks,

Edited by gazeranco
Link to comment
Share on other sites

wait... no it doesn't, but it's ok... there appears to be an issue in the format of the command, it seems to be reading the directories as 2 different installs, it tries silently and reports no erros... cos its silent, when i take s away it asks me i say ok and then it asks me twice and there appears to be a problem with the directory structure... ill look at code again.

Link to comment
Share on other sites

Have you tried modifying the registry settings with AutoIt and not the .reg file?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

RegWrite doesn't look easier?

I have what you put there, ("c:windowsregedit.exe /s c:folder spacemyregfile.reg')

If I run the example here, i will get this error...

regedit --> are you sure you want to run... "c:folder" --> ok, file does not exist!

then again

regedit --> are you sure you want to run... "spacemyregfile.reg" --> ok, file does not exist!

Link to comment
Share on other sites

You missed where Emiel used single quotes around the whole string, and double quotes around the path and filename of your .reg file.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

BTW, if you wrote the program, and I assume you also wrote the .reg file, then using RegWrite to recreate the keys/values on the machine you're installing on shouldn't be that difficult, after all, 90% of the work is already done inside the .reg file. It's mostly just cut and paste from there.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Moderators

I would only add the caveat that it depends upon the number of registry entries. I worked on an install package that included several hundred entries, scattered among all the hives. In that case I opted for the one .reg file over a couple hundred RegWrites.

My preference, however, is to use shellexecute as it is a little easier to separate the program from the switches. I use this:

ShellExecute("regedit.exe", '/s "' & @DesktopDir & 'Mykey.reg"')
Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Didn't you have to write the reg file initially, or at least the registry entries? I don't see how installing a reg file is any different than doing it programmatically. Also, if this is being done in any type of corporate environment, regedit is usually disable.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Moderators

I did have to write the reg file initially, though for some of it I was able to do an export and merge, but you definitely have a point :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Just a side note, as this might help another noob.

Windows does something called installer detection, so if you call your file setup.exe or installer.exe it will think it's an installer (which it kind of is!) and more than likely display a message at the end saying "this file failed to install properly" because your not doing things windows expects from an installer I guess...

So call it something more ambigious, like RunMe.exe. I am sure the detection process is more complex than this, but just renaming the output .exe worked for me.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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